Problem/Motivation
function user_template_preprocess_default_variables_alter(&$variables) {
$user = \Drupal::currentUser();
if (!is_object($user)) {
}
}
This is_object call is pointless because currentUser() would have thrown an exception otherwise
Proposed resolution
Remove that bit of code.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 2541340-1.patch | 749 bytes | dawehner |
Comments
Comment #1
dawehnerDiff%
Diff
(microsec)
Diff%
MemUse
Diff
(bytes)
Diff%
PeakMemUse
Diff
(bytes)
Diff%
Comment #2
dawehner.
Comment #3
dawehnerMh some microbenchmarking doesn't show that.
Comment #4
dawehnerIgnore that profiling, it still simplifies the code.
Comment #5
jibranBeta eval: non disruptive removing dead code.
Let's classify it as normal task.
Comment #6
alexpottRemoving dead code is permitted in beta. Committed 6366f77 and pushed to 8.0.x. Thanks!