Skip to content

Commit

Permalink
Remove redundant unitsPatterns that are equals to other (#5331)
Browse files Browse the repository at this point in the history
  • Loading branch information
younies authored Aug 6, 2024
1 parent 3fd10e0 commit e0655a9
Show file tree
Hide file tree
Showing 18 changed files with 15 additions and 186 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

101 changes: 2 additions & 99 deletions provider/data/experimental/fingerprints.csv
Original file line number Diff line number Diff line change
Expand Up @@ -1359,119 +1359,22 @@ currency/extended@1, zu/EGP, 71B, 97650516a7e7847d
currency/extended@1, zu/EUR, 61B, 70f4a5b6bbcd9e19
currency/extended@1, zu/GBP, 70B, 62ef73dd0f1265ed
currency/extended@1, zu/USD, 66B, ccf8b1189fca0543
currency/patterns@1, <lookup>, 466B, 111 identifiers
currency/patterns@1, <total>, 1425B, 18 unique payloads
currency/patterns@1, af, 72B, d8d61f75068256c3
currency/patterns@1, am, 72B, -> af
currency/patterns@1, ar, 112B, c4eaa9d7d1100a0a
currency/patterns@1, as, 72B, -> af
currency/patterns@1, ast, 72B, -> af
currency/patterns@1, az, 72B, -> af
currency/patterns@1, be, 92B, 2b1d04ec9bc3efaf
currency/patterns@1, bg, 72B, -> af
currency/patterns@1, <lookup>, 94B, 14 identifiers
currency/patterns@1, <total>, 617B, 9 unique payloads
currency/patterns@1, blo, 82B, da128faf13fad0d5
currency/patterns@1, bn, 72B, -> af
currency/patterns@1, br, 102B, bd0541f7b4132a93
currency/patterns@1, brx, 72B, -> af
currency/patterns@1, bs, 82B, 28cfd6b0a5488bcb
currency/patterns@1, bs-Cyrl, 82B, -> bs
currency/patterns@1, ca, 72B, -> af
currency/patterns@1, ceb, 72B, db7c7c84fecaf3d0
currency/patterns@1, chr, 72B, -> af
currency/patterns@1, cs, 92B, -> be
currency/patterns@1, cy, 112B, -> ar
currency/patterns@1, da, 72B, -> af
currency/patterns@1, de, 72B, -> af
currency/patterns@1, doi, 72B, -> af
currency/patterns@1, dsb, 92B, c0b5868748b28367
currency/patterns@1, el, 72B, -> af
currency/patterns@1, en, 72B, -> af
currency/patterns@1, es, 72B, -> af
currency/patterns@1, es-GT, 72B, -> ceb
currency/patterns@1, et, 72B, -> af
currency/patterns@1, eu, 72B, -> af
currency/patterns@1, fa, 72B, -> af
currency/patterns@1, ff-Adlm, 72B, -> af
currency/patterns@1, fi, 72B, -> af
currency/patterns@1, fil, 72B, -> af
currency/patterns@1, fo, 72B, -> af
currency/patterns@1, fr, 72B, -> af
currency/patterns@1, fy, 72B, -> af
currency/patterns@1, ga, 102B, -> br
currency/patterns@1, gd, 92B, -> dsb
currency/patterns@1, gl, 72B, -> af
currency/patterns@1, gu, 72B, -> af
currency/patterns@1, ha, 72B, -> af
currency/patterns@1, he, 92B, 18eff31cb2ed7017
currency/patterns@1, hi, 72B, -> af
currency/patterns@1, hr, 82B, -> bs
currency/patterns@1, hsb, 92B, -> dsb
currency/patterns@1, hu, 72B, -> af
currency/patterns@1, hy, 72B, -> af
currency/patterns@1, ia, 72B, -> af
currency/patterns@1, is, 72B, -> af
currency/patterns@1, it, 72B, -> af
currency/patterns@1, ja, 61B, 9af35aad6ebc7d70
currency/patterns@1, ka, 72B, -> af
currency/patterns@1, kgp, 72B, -> af
currency/patterns@1, kk, 72B, -> af
currency/patterns@1, kn, 72B, -> af
currency/patterns@1, ks, 72B, -> af
currency/patterns@1, ks-Deva, 72B, -> af
currency/patterns@1, ku, 72B, -> af
currency/patterns@1, ky, 72B, -> af
currency/patterns@1, lb, 72B, -> af
currency/patterns@1, lt, 92B, -> be
currency/patterns@1, lv, 82B, b494633fd6da9a81
currency/patterns@1, mk, 72B, -> af
currency/patterns@1, ml, 72B, -> af
currency/patterns@1, mn, 72B, -> af
currency/patterns@1, mr, 72B, -> af
currency/patterns@1, mt, 102B, -> br
currency/patterns@1, my, 62B, 86cee97085536d8b
currency/patterns@1, ne, 72B, -> af
currency/patterns@1, nl, 72B, -> af
currency/patterns@1, no, 72B, -> af
currency/patterns@1, or, 72B, -> af
currency/patterns@1, pa, 72B, -> af
currency/patterns@1, pcm, 72B, -> af
currency/patterns@1, pl, 92B, -> be
currency/patterns@1, ps, 72B, -> af
currency/patterns@1, pt, 72B, -> af
currency/patterns@1, rm, 72B, -> af
currency/patterns@1, ro, 85B, 629b2b7dcea97875
currency/patterns@1, ru, 92B, -> be
currency/patterns@1, sat, 82B, 43441c2d3c301561
currency/patterns@1, sc, 72B, -> af
currency/patterns@1, sd, 48B, 3a6d9523170345d0
currency/patterns@1, sd-Deva, 72B, -> af
currency/patterns@1, si, 71B, 4f661a4fd0c9c312
currency/patterns@1, sk, 92B, -> be
currency/patterns@1, sl, 92B, -> dsb
currency/patterns@1, so, 72B, -> af
currency/patterns@1, sq, 72B, -> af
currency/patterns@1, sr, 82B, -> bs
currency/patterns@1, sr-Latn, 82B, -> bs
currency/patterns@1, sv, 72B, -> af
currency/patterns@1, sw, 72B, -> ceb
currency/patterns@1, ta, 72B, -> af
currency/patterns@1, te, 72B, -> af
currency/patterns@1, ti, 72B, -> af
currency/patterns@1, tk, 72B, -> af
currency/patterns@1, to, 62B, -> my
currency/patterns@1, tr, 72B, -> af
currency/patterns@1, ug, 72B, -> af
currency/patterns@1, uk, 92B, -> be
currency/patterns@1, und, 62B, 22ee41f60d78bf20
currency/patterns@1, ur, 72B, -> af
currency/patterns@1, uz, 72B, -> af
currency/patterns@1, uz-Cyrl, 72B, -> af
currency/patterns@1, vec, 74B, 9f4972550abb7df
currency/patterns@1, xh, 72B, -> af
currency/patterns@1, yrl, 72B, -> af
currency/patterns@1, zh, 61B, -> ja
currency/patterns@1, zh-SG, 62B, -> und
currency/patterns@1, zu, 72B, -> af
displaynames/languages@1, <lookup>, 1051B, 209 identifiers
displaynames/languages@1, <total>, 1557050B, 194 unique payloads
displaynames/languages@1, af, 5898B, a2f3d9fa576f610
Expand Down
5 changes: 0 additions & 5 deletions provider/source/data/debug/currency/patterns@1/ar-EG.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions provider/source/data/debug/currency/patterns@1/ar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion provider/source/data/debug/currency/patterns@1/bn.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion provider/source/data/debug/currency/patterns@1/ccp.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion provider/source/data/debug/currency/patterns@1/en-001.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion provider/source/data/debug/currency/patterns@1/en-ZA.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion provider/source/data/debug/currency/patterns@1/en.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion provider/source/data/debug/currency/patterns@1/es-AR.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion provider/source/data/debug/currency/patterns@1/es.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion provider/source/data/debug/currency/patterns@1/fil.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion provider/source/data/debug/currency/patterns@1/fr.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions provider/source/data/debug/currency/patterns@1/ru.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions provider/source/data/debug/currency/patterns@1/sr-Latn.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions provider/source/data/debug/currency/patterns@1/sr.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion provider/source/data/debug/currency/patterns@1/tr.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions provider/source/src/currency/patterns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,15 @@ impl DataProvider<CurrencyPatternsDataV1Marker> for SourceDataProvider {
.default_numbering_system
.as_str();

let patterns = &numbers_resource
let currency_patterns = &numbers_resource
.main
.value
.numbers
.numsys_data
.currency_patterns
.currency_patterns;

// `default_patterns` is the patterns that came from the default numbering system
let patterns = &currency_patterns
.get(default_system)
.ok_or(DataErrorKind::IdentifierNotFound.into_error())?;

Expand All @@ -52,7 +55,11 @@ impl DataProvider<CurrencyPatternsDataV1Marker> for SourceDataProvider {
(PatternCount::Other, patterns.pattern_other.as_deref()),
]
.into_iter()
.filter_map(|(count, pattern)| pattern.map(|pattern| (count, pattern))),
.filter_map(|(count, pattern)| match (count, pattern) {
(PatternCount::Other, pattern) => Some((count, pattern?)),
(_, pattern) if pattern == patterns.pattern_other.as_deref() => None,
_ => Some((count, pattern?)),
}),
),
}),
})
Expand Down

0 comments on commit e0655a9

Please sign in to comment.