Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
Follow up from change 49c2427, copying the comment from the Java implementation to the C++ impl.
  • Loading branch information
andyst committed Feb 18, 2015
1 parent 49c2427 commit 8d21a36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cpp/src/phonenumbers/asyoutypeformatter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,8 @@ char AsYouTypeFormatter::NormalizeAndAccrueDigitsAndPlusSign(
void AsYouTypeFormatter::InputDigitHelper(char next_char, string* number) {
DCHECK(number);
number->clear();
// Note that formattingTemplate is not guaranteed to have a value, it could be
// empty, e.g. when the next digit is entered after extracting an IDD or NDD.
const char32 placeholder_codepoint = UnicodeString(kDigitPlaceholder)[0];
int placeholder_pos = formatting_template_
.tempSubString(last_match_position_).indexOf(placeholder_codepoint);
Expand Down
2 changes: 2 additions & 0 deletions javascript/i18n/phonenumbers/asyoutypeformatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,8 @@ i18n.phonenumbers.AsYouTypeFormatter.prototype.
i18n.phonenumbers.AsYouTypeFormatter.prototype.inputDigitHelper_ =
function(nextChar) {

// Note that formattingTemplate is not guaranteed to have a value, it could be
// empty, e.g. when the next digit is entered after extracting an IDD or NDD.
/** @type {string} */
var formattingTemplate = this.formattingTemplate_.toString();
if (formattingTemplate.substring(this.lastMatchPosition_)
Expand Down

0 comments on commit 8d21a36

Please sign in to comment.