-
-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CRM-20157, CRM-20195 Dedupe code cleanup #9907
Conversation
Using a class property and a local variable for the same thing just causes confusion
@JKingsnorth this is still on the theme of minor code tidy-ups |
a192ec7
to
fcc3d8e
Compare
@@ -282,7 +282,7 @@ public static function retrieve($cacheKey, $join = NULL, $whereClause = NULL, $o | |||
|
|||
if (!empty($select)) { | |||
$extraData = array(); | |||
foreach ($select as $dfield => $sfield) { | |||
foreach ($select as $sfield) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
foreaches are faster if you specify the index - or so I hear?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a quick google & didn't find anything to support that. Mostly I found for vs foreach - e.g https://coderwall.com/p/il1tog/php-for-vs-foreach-benchmark - but in general most of what I found was php 5.3 or 5.4- I expect it changes each php version
@JKingsnorth is this OK to merge? |
Sorry, testing this fully now |
Tested:
All seems OK. |
Thanks again @JKingsnorth |
CRM-20157, CRM-20195 Dedupe code cleanup
unused variables, remove deprecated fatals.
Unfortunately the deprecated fatals removal made it hard to read as it alters the indentation by adding a try-catch :-( The only change in that commit is the try-catch addition + the removal of the fatals