Just looking at a profile, I was struck by the cost of: OUString aStr; ... aStr = OUString(); Where we use the assignment to clear aStr; this in-lines a construction, a de-reference and an assign call ;-) it is done quite a bit too: git grep ' = OUString()' | nl it'd be nice to have the obvious cleanup implement a 'clear()' method on OString and OUString thus include/rtl/ustring.hxx and rtl/string.hxx void clear() { rtl_uString_new( &pData ); } And then cleanup the call-sites I guess =) Thanks !
Hi, I would like to work on this bug. Can you please provide more info about rtl_uString_new( &pData ) method and when will the clear() method be called? P.S: This is my first bug. Thanks!
Hi, I have implemented the clear() method on OString and OUString classes. I will replace appropriate assignments of '= OUString()' to call clear() method. Can you please suggest how to test it? Thanks!
Neato - glad you've done that; wrt. testing - I'd run "make check" in the top-level =) if that works before and after your patch, that's a good sign. The rest is just code-review I think. Looking forward to reading your patch =) please do -only- this change in it; no other cleanups of nearby code etc. [ that makes it much easier to review ].
Hi, I have pushed the patch to gerrit. Here's the link. https://gerrit.libreoffice.org/12391 Kindly review.
Hi, I uploaded the new patch set as per Stephan's comments. Kindly review! Thanks.
Brij Mohan Lal Srivastava committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=d32be3ace8c8fd430bbecdf69f88a116b0ee91d1 fdo#86023 - O[U]String needs a 'clear' method It will be available in 4.4.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Migrating Whiteboard tags to Keywords: (EasyHack DifficultyBeginner SkillCpp TopicCleanup) [NinjaEdit]