forked from statamic/cms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add optionItems method to improve performance ...
This method gets an array of Item instances that would be used for each option. To make it backwards compatible, a method is added to the abstract class. It's not performant, but it works. The BasicDictionary class overrides it to make it performant. If someone is making a dictionary that extends the base class, they don't have to override it, but they can if they want to improve the performance. This is all done because ->options() would get the options, then calling ->get() is happening for each option, which would end up getting all the options for each one. In the case of the file dictionary for example, this means the file is read and parsed for each line in the file.
- Loading branch information
1 parent
55caaf3
commit b76304b
Showing
3 changed files
with
16 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters