Skip to content

Commit 3c59a12

Browse files
committed
more efficient call order
1 parent dc7209f commit 3c59a12

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

+stdlib/disk_available.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
f = uint64(0);
1313
if ~stdlib.exists(d), return, end
1414

15-
if stdlib.has_python()
16-
f = py_disk_available(d);
17-
elseif stdlib.has_dotnet()
15+
if stdlib.has_dotnet()
1816
f = System.IO.DriveInfo(stdlib.absolute(d)).AvailableFreeSpace();
1917
% https://learn.microsoft.com/en-us/dotnet/api/system.io.driveinfo.availablefreespace
2018
elseif stdlib.has_java()
2119
f = javaObject("java.io.File", d).getUsableSpace();
20+
elseif stdlib.has_python()
21+
f = py_disk_available(d);
2222
end
2323

2424
f = uint64(f);

+stdlib/disk_capacity.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
f = uint64(0);
1111
if ~stdlib.exists(d), return, end
1212

13-
if stdlib.has_python()
14-
f = py_disk_capacity(d);
15-
elseif stdlib.has_dotnet()
13+
if stdlib.has_dotnet()
1614
f = System.IO.DriveInfo(stdlib.absolute(d)).TotalSize();
1715
% https://learn.microsoft.com/en-us/dotnet/api/system.io.driveinfo.totalsize
1816
elseif stdlib.has_java()
1917
f = javaObject("java.io.File", d).getTotalSpace();
18+
elseif stdlib.has_python()
19+
f = py_disk_capacity(d);
2020
end
2121

2222
f = uint64(f);

0 commit comments

Comments
 (0)