json parser: optimize redunant calls