fleece-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hendrik Dev <hendrikde...@gmail.com>
Subject JsonGeneratorImpl key cache
Date Sat, 26 Jul 2014 11:08:21 GMT
Hi,

just looking into JsonGeneratorImpl.
What does "we cache key only since they are generally fixed" mean?
How to fix them "generally"?


// we cache key only since they are generally fixed

    private String key(final String name) {

        if (name == null) {

            return NULL_KEY;

        }

        String k = cache.get(name);

        if (k == null) {

            k = '"' + Strings.escape(name) + "\":";

            cache.putIfAbsent(name, k);

        }

        return k;

    }

Thanks
Hendrik

-- 
Hendrik Saly (salyh, hendrikdev22)
@hendrikdev22
PGP: 0x22D7F6EC

Mime
View raw message