Commit 0c5f715
committed
Don't recreate PluralFormsCalculator needlessly
Add caching to PluralFormsExpr::calc() so that plural expressions are
only parsed once and the created calculator objects are reused.
This is MT safe, because the calculator, once constructed, is const and
doesn't modify its internal state.1 parent 68a3699 commit 0c5f715
2 files changed
Lines changed: 25 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
803 | 803 | | |
804 | 804 | | |
805 | 805 | | |
806 | | - | |
807 | 806 | | |
808 | 807 | | |
| 808 | + | |
809 | 809 | | |
810 | | - | |
811 | | - | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
812 | 832 | | |
813 | 833 | | |
814 | 834 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
238 | | - | |
239 | | - | |
| 238 | + | |
| 239 | + | |
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
0 commit comments