Skip to content

Commit 502429c

Browse files
committed
is* don't coerce input for efficiency
1 parent d58f7b8 commit 502429c

File tree

10 files changed

+13
-13
lines changed

10 files changed

+13
-13
lines changed

+stdlib/is_char_device.m

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

77
function ok = is_char_device(p)
88
arguments
9-
p (1,1) string
9+
p {mustBeTextScalar}
1010
end
1111

1212
if stdlib.isoctave()

+stdlib/is_exe.m

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

55
function ok = is_exe(p)
66
arguments
7-
p (1,1) string
7+
p {mustBeTextScalar}
88
end
99

1010
a = file_attributes(p);

+stdlib/is_prefix.m

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

55
function s = is_prefix(prefix, pth)
66
arguments
7-
prefix (1,1) string
8-
pth (1,1) string
7+
prefix {mustBeTextScalar}
8+
pth {mustBeTextScalar}
99
end
1010

1111
pr = stdlib.drop_slash(prefix);

+stdlib/is_readable.m

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

55
function ok = is_readable(p)
66
arguments
7-
p (1,1) string
7+
p {mustBeTextScalar}
88
end
99

1010
a = file_attributes(p);

+stdlib/is_regular_file.m

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

44
function r = is_regular_file(p)
55
arguments
6-
p (1,1) string
6+
p {mustBeTextScalar}
77
end
88

99
% needs absolute()
10-
p = stdlib.absolute(p, "", false);
10+
p = stdlib.absolute(p, '', false);
1111

1212
op = javaPathObject(p);
1313
opt = javaLinkOption();

+stdlib/is_subdir.m

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

55
function s = is_subdir(subdir, dir)
66
arguments
7-
subdir (1,1) string
8-
dir (1,1) string
7+
subdir {mustBeTextScalar}
8+
dir {mustBeTextScalar}
99
end
1010

1111
s = stdlib.drop_slash(subdir);

+stdlib/is_symlink.m

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

44
function ok = is_symlink(p)
55
arguments
6-
p (1,1) string
6+
p {mustBeTextScalar}
77
end
88

99

+stdlib/is_url.m

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

44
function y = is_url(s)
55
arguments
6-
s (1,1) string
6+
s {mustBeTextScalar}
77
end
88

99
try

+stdlib/is_writable.m

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

55
function ok = is_writable(p)
66
arguments
7-
p (1,1) string
7+
p {mustBeTextScalar}
88
end
99

1010
a = file_attributes(p);

+stdlib/private/file_attributes.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function a = file_attributes(p)
22
arguments
3-
p (1,1) string
3+
p {mustBeTextScalar}
44
end
55

66
a = [];

0 commit comments

Comments
 (0)