Skip to content

Commit

Permalink
avoid side effect of removing singletarray
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed May 2, 2019
1 parent 8360fd1 commit 1b1be65
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion savejson.m
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@
end
else
if(numel(item)==1 && jsonopt('SingletArray',0,varargin{:})==0 && level>0)
numtxt=regexprep(regexprep(matdata2json(item,level+1,varargin{:}),'^\[',''),']','');
numtxt=regexprep(regexprep(matdata2json(item,level+1,varargin{:}),'^\[',''),']$','');
else
numtxt=matdata2json(item,level+1,varargin{:});
end
Expand Down
2 changes: 1 addition & 1 deletion saveubjson.m
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@
txt=matdata2ubjson(item,level+1,varargin{:});
else
if(numel(item)==1 && jsonopt('SingletArray',0,varargin{:})==0)
numtxt=regexprep(regexprep(matdata2ubjson(item,level+1,varargin{:}),'^\[',''),']','');
numtxt=regexprep(regexprep(matdata2ubjson(item,level+1,varargin{:}),'^\[',''),']$','');
txt=[N_(checkname(name,varargin{:})) numtxt];
else
txt=[N_(checkname(name,varargin{:})),matdata2ubjson(item,level+1,varargin{:})];
Expand Down

0 comments on commit 1b1be65

Please sign in to comment.