Skip to content

Commit d84670b

Browse files
committed
more robust, fast
1 parent 3889872 commit d84670b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

+stdlib/strempty.m

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55

66
if isempty(s)
77
y = true;
8-
else
9-
y = (strlength(s) == 0);
10-
if isstring(s)
11-
y = y | ismissing(s);
12-
end
8+
elseif ischar(s)
9+
y = isempty(s);
10+
elseif isstring(s)
11+
y = (strlength(s) == 0) | ismissing(s);
1312
end
1413

1514
end

0 commit comments

Comments
 (0)