Mercurial Hosting > luan
comparison src/goodjava/json/JsonToString.java @ 1485:6a24c8b33d6b
minor
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Fri, 01 May 2020 11:23:29 -0600 |
parents | 509736ad42e6 |
children | f989778ca9e1 |
comparison
equal
deleted
inserted
replaced
1484:1fa6e8ec2d53 | 1485:6a24c8b33d6b |
---|---|
119 private void toString(List list,StringBuilder sb,int indented) { | 119 private void toString(List list,StringBuilder sb,int indented) { |
120 sb.append('['); | 120 sb.append('['); |
121 if( !list.isEmpty() ) { | 121 if( !list.isEmpty() ) { |
122 indent(sb,indented+1); | 122 indent(sb,indented+1); |
123 toString(list.get(0),sb,indented+1); | 123 toString(list.get(0),sb,indented+1); |
124 for( int i=1; i<list.size(); i++ ) { | 124 final int n = list.size(); |
125 for( int i=1; i<n; i++ ) { | |
125 sb.append(comma); | 126 sb.append(comma); |
126 toString(list.get(i),sb,indented+1); | 127 toString(list.get(i),sb,indented+1); |
127 } | 128 } |
128 indent(sb,indented); | 129 indent(sb,indented); |
129 } | 130 } |