Merge lp:~paul-lucas/zorba/pjl-misc into lp:zorba

Proposed by Paul J. Lucas
Status: Merged
Approved by: Matthias Brantner
Approved revision: 11161
Merged at revision: 11343
Proposed branch: lp:~paul-lucas/zorba/pjl-misc
Merge into: lp:zorba
Diff against target: 25 lines (+3/-4)
1 file modified
src/runtime/numerics/format_integer.cpp (+3/-4)
To merge this branch: bzr merge lp:~paul-lucas/zorba/pjl-misc
Reviewer Review Type Date Requested Status
Matthias Brantner Approve
Paul J. Lucas Approve
Review via email: mp+157152@code.launchpad.net

Commit message

Now calling unicode::is_Nd() only when necessary.

Description of the change

Now calling unicode::is_Nd() only when necessary.

To post a comment you must log in.
Revision history for this message
Paul J. Lucas (paul-lucas) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job pjl-misc-2013-04-04T16-18-40.299Z is finished. The final status was:

All tests succeeded!

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Voting does not meet specified criteria. Required: Approve > 1, Disapprove < 1, Needs Fixing < 1, Pending < 1, Needs Information < 1, Resubmit < 1. Got: 1 Approve.

Revision history for this message
Matthias Brantner (matthias-brantner) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job pjl-misc-2013-04-04T17-54-37.264Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/runtime/numerics/format_integer.cpp'
2--- src/runtime/numerics/format_integer.cpp 2013-04-01 02:22:49 +0000
3+++ src/runtime/numerics/format_integer.cpp 2013-04-04 16:16:28 +0000
4@@ -237,18 +237,17 @@
5 if ( !mandatory_digits && !mandatory_grouping_seps && n_i == n_end )
6 break;
7 unicode::code_point const pic_cp = *pic_i++;
8- bool const is_mandatory_digit = unicode::is_Nd( pic_cp );
9- if ( pic_cp == '#' || is_mandatory_digit ) {
10+ if ( pic_cp == '#' || unicode::is_Nd( pic_cp ) ) {
11 u_dest.insert( 0, 1, digit_cp );
12 if ( n_i != n_end ) ++n_i;
13 ++digit_pos;
14+ if ( pic_cp != '#' )
15+ --mandatory_digits;
16 } else { // must be a grouping-separator
17 grouping_cp = pic_cp; // remember for later
18 u_dest.insert( 0, 1, grouping_cp );
19 --mandatory_grouping_seps;
20 }
21- if ( is_mandatory_digit )
22- --mandatory_digits;
23 } else { // have exhausted the picture
24 if ( pic.primary.grouping_interval &&
25 digit_pos % pic.primary.grouping_interval == 0 ) {

Subscribers

People subscribed via source and target branches