Commit 24f2fb6
committed
Optimize EntityId::isForeign()
When this method was first introduced, getRepositoryName() would split
the serialization each time it was called, and using strpos() in
isForeign() was an optimization to avoid that cost. However, since #769
(commit eb66561), the serialization is only split once in the
constructor, so checking strpos each time instead of deferring to the
already populated $repositoryName is probably slightly more expensive.
As a very minor optimization, we directly access $this->repositoryName
instead of calling getRepositoryName(). Subclasses that for some reason
override getRepositoryName() to do something different must override
isForeign() as well.1 parent f68fa92 commit 24f2fb6
2 files changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
| 167 | + | |
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
175 | | - | |
| 174 | + | |
176 | 175 | | |
177 | 176 | | |
178 | 177 | | |
| |||
0 commit comments