Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#23 redundant call of strlen()

Unstable (example)
closed-out-of-date
nobody
None
5
2015-03-06
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.

     
    • status: open --> closed-out-of-date