Skip to content

Commit c9e4158

Browse files
committed
remove unneeded argument checks
1 parent c272aa6 commit c9e4158

File tree

9 files changed

+16
-14
lines changed

9 files changed

+16
-14
lines changed

+stdlib/extract_zstd.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
function extract_zstd(archive, out_dir)
55
arguments
6-
archive (1,1) string {mustBeFile}
7-
out_dir (1,1) string {mustBeFolder}
6+
archive (1,1) string
7+
out_dir (1,1) string
88
end
99

1010
archive = stdlib.absolute(archive);

+stdlib/file_size.m

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22

33
function s = file_size(p, use_java)
44
arguments
5-
p (1,1) string {mustBeFile}
5+
p (1,1) string
66
use_java (1,1) logical = false
77
end
88

9-
if use_java
9+
s = [];
10+
11+
if ~isfile(p)
12+
return
13+
elseif use_java
1014
s = javaFileObject(p).length();
1115
else
1216
s = dir(p);
13-
if isempty(s)
14-
s = [];
15-
else
17+
if ~isempty(s)
1618
s = s.bytes;
1719
end
1820
end

+stdlib/h4variables.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
function names = h4variables(file)
1212
arguments
13-
file (1,1) string {mustBeFile}
13+
file (1,1) string
1414
end
1515

1616
finf = hdfinfo(file);

+stdlib/h5exists.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
function exists = h5exists(file, variable)
1010
arguments
11-
file (1,1) string {mustBeFile}
11+
file (1,1) string
1212
variable (1,1) string
1313
end
1414

+stdlib/h5variables.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
function names = h5variables(file, group)
1212
arguments
13-
file (1,1) string {mustBeFile}
13+
file (1,1) string
1414
group (1,1) string = ""
1515
end
1616

+stdlib/ini2struct.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
function Struct = ini2struct(filename)
77
arguments
8-
filename (1,1) string {mustBeFile}
8+
filename (1,1) string
99
end
1010

1111
f = fopen(filename,'r'); % open file

+stdlib/ncexists.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
function exists = ncexists(file, variable)
1010
arguments
11-
file (1,1) string {mustBeFile}
11+
file (1,1) string
1212
variable (1,1) string
1313
end
1414

+stdlib/ncsize.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
function fsize = ncsize(file, variable)
1111
arguments
12-
file (1,1) string {mustBeFile}
12+
file (1,1) string
1313
variable (1,1) string
1414
end
1515

+stdlib/ncvariables.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
function names = ncvariables(file, group)
1212
arguments
13-
file (1,1) string {mustBeFile}
13+
file (1,1) string
1414
group (1,1) string = ""
1515
end
1616

0 commit comments

Comments
 (0)