This is a static copy of a profile report

Home

imagesci/private/writepng>CheckTextItem (Calls: 10, Time: 0.001 s)
Generated 16-Jul-2020 17:09:41 using performance time.
subfunction in file /Applications/MATLAB_R2020a.app/toolbox/matlab/imagesci/private/writepng.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
imagesci/private/writepngfunction10
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
384
badChars = find((out < 32) ...
100.000 s24.3%
383
out = strrep(out, char(13), ch...
100.000 s21.8%
382
out = strrep(out, char([13 10]...
100.000 s18.3%
388
end
100.000 s1.0%
385
if (~isempty(badChars))
100.000 s0.2%
All other lines  0.000 s34.4%
Totals  0.001 s100% 
Children (called functions)
No children
Code Analyzer results
Line numberMessage
382For readability, consider using 'newline' instead of 'char(10)'.
383For readability, consider using 'newline' instead of 'char(10)'.
Coverage results
Show coverage for parent directory
Total lines in function18
Non-code lines (comments, blank lines)7
Code lines (lines that can run)11
Code lines that did run8
Code lines that did not run3
Coverage (did run/can run)72.73 %
Function listing
time 
Calls 
 line
 371 
function out = CheckTextItem(in)
 372 
%CheckTextItem
 373 
%   out = CheckTextItem(in) strips out control characters from text; PNG spec
 374 
%   discourages them.  It also replaces [13 10] by 10; then it replaces 13
 375 
%   by 10.  The PNG spec says newlines must be represented by a single 10.
 376 

< 0.001 
     10 
 377
if (~ischar(in)) 
 378 
    error(message('MATLAB:imagesci:writepng:invalidTextChunk'));
< 0.001 
     10 
 379
end 
 380 

< 0.001 
     10 
 381
out = in; 
< 0.001 
     10 
 382
out = strrep(out, char([13 10]), char(10)); 
< 0.001 
     10 
 383
out = strrep(out, char(13), char(10)); 
< 0.001 
     10 
 384
badChars = find((out < 32) & (out ~= 10)); 
< 0.001 
     10 
 385
if (~isempty(badChars)) 
 386 
    warning(message('MATLAB:imagesci:writepng:changedTextChunk'));
 387 
    out(badChars) = [];
< 0.001 
     10 
 388
end 

Other subfunctions in this file are not included in this listing.