Skip to content

Commit

Permalink
only write the opening '[' after the first object is received
Browse files Browse the repository at this point in the history
  • Loading branch information
neonstalwart committed Feb 25, 2015
1 parent 7fecf7f commit a64636a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion media/json.js
Expand Up @@ -28,11 +28,11 @@ function StreamingSerializer(stringify){
write("{}&&");
}
// progressively stream arrays for better performance and memory
write("[")
var first = true;
var undefined; // make it a fast, closely-scoped lookup
return when(object.forEach(function(item){
if(first){
write("[")
first = false;
}
else{
Expand Down

0 comments on commit a64636a

Please sign in to comment.