Skip to content

Commit

Permalink
Remove duplicates from inputOutputFile mappings
Browse files Browse the repository at this point in the history
Reduce the number of entries in the IOFileMappings. This reduces compile
time on my PC down from 3 hours to 3 minutes.
  • Loading branch information
giggsey committed Jan 25, 2014
1 parent dd9e3a6 commit 564614c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion build/libphonenumber/buildtools/GeneratePhonePrefixData.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ private function createOutputFileNames($file, $countryCode, $language)
$this->parseTextFile(
$this->getFilePathFromLanguageAndCountryCode($language, $countryCode),
function ($prefix, $location) use (&$phonePrefixes) {
$phonePrefixes[] = substr($prefix, 0, 4);
$shortPrefix = substr($prefix, 0, 4);
if (!in_array($shortPrefix, $phonePrefixes)) {
$phonePrefixes[] = $shortPrefix;
}
}
);

Expand Down

0 comments on commit 564614c

Please sign in to comment.