View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006975 | OXID eShop (all versions) | 4.07. Source code, Test | public | 2019-04-24 15:41 | 2019-05-03 14:15 |
Reporter | Sioweb | Assigned To | |||
Priority | low | Severity | tweak | Reproducibility | always |
Status | closed | Resolution | no change required | ||
Summary | 0006975: count() > 0 durch !empty() ersetzen | ||||
Description | Ho! i've seen that u fixed the php countable-warning with "is_array && count". Wouldn't it better to replace it with "!empty()" ? This will be only one operation and empty produce less overhead than count() for larger arrays. Not that big deal but i think some hosts will be happy about some extra KiB memory :) https://github.com/OXID-eSales/oxideshop_ce/blob/master/source/Application/Model/Basket.php#L1616 Also smarty can deal with isset() and empty(); to avoid |@count() // the @-error-prevention is also a little performance eater because it still call error function but as level zero. | ||||
Tags | Performance | ||||
Theme | Flow | ||||
Browser | Not defined | ||||
PHP Version | Not defined | ||||
Database Version | Not defined | ||||
|
Hello Sloweb, you are right. That statement could also be made with "!empty". I would like to ask you to create a pull request if you want to improve the source code: https://github.com/OXID-eSales/oxideshop_ce/blob/master/CONTRIBUTING.md It will be greatly appreciated. I will close this entry as it isn't about a specific bug, but suggesting to improve the code quality in generally. Kind regards QA -MK |