Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#23 redundant call of strlen()

Unstable (example)
open
nobody
None
5
2014-04-19
2013-10-10
Matthias Loy
No

We are happily using your fine jsoncpp on our embedded system. We don't have a very powerfull CPU in there. Hence the software should be as efficient as possible.

yesterday something caught my eye:
json_writer::valueToString uses sprintf. Afterwards the lentgh of the resulting string is being calculated. Why not using the length returnd by sprintf?

Attached you can find a diff file.

best regards,
Matthias Loy

1 Attachments

Discussion

  • Good idea, but valueToString() has changed. Not needed anymore.