make Hh_json.escape write substrings instead of every char
commitacda561c4bcb2c8ee790b82fe7006199a7f0e16f
authorMarshall Roch <mroch@fb.com>
Tue, 12 Dec 2017 01:02:00 +0000 (11 17:02 -0800)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Tue, 12 Dec 2017 01:08:30 +0000 (11 17:08 -0800)
treef2fb1f18263af010a787b6ca35e014cfb6938fd5
parentab2bedae53eb0669c9376fecd79da789f73cd6ac
make Hh_json.escape write substrings instead of every char

Summary: instead of iterating a string and writing each char individually, wait until we see a char that needs to be escaped and then write the whole preceeding substring.

Reviewed By: samwgoldman

Differential Revision: D6535871

fbshipit-source-id: 27e35000142933d8bdb83d8fc37acf68740be51f
hphp/hack/src/utils/hh_json/hh_json.ml