Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ICU-22679 Refactor Islamic Calendar and Optmize starting condition of…
… loop. Refactor different rules into implementation of private interface Algorithm. Since IslamicCalendar is public in Java (not in C++), we cannot put them into different subclass of Calendar and have to let them use the same class and object since the caller UNFORTUNALLY can call setCalculationType and setCivil to change the object to different rule. With this refactoring, we group the formula for the same rule into the same Algorithm implementaiton and now we only do the if/switch check in the constructor or during the call of setCalculationType and setCivil only. The calculation operation is then just delegate the work to the assigned concrete Algorithm. Improve the efficency while the month is very large. Apply the same optimization in PR 2853 which estimate starting point of year iteration based on an inverse calculation. ICU-22679 change parameter name ICU-22679 Use Consumer
- Loading branch information