Bot to automatically flag unnecessary comments on Stack Overflow after a year
I think these are all false posivites and I can't see anything actionable here.
This is a follow up to the discussion from #247.
During normal usage, I noticed this function is very inefficient. It doesn't use the built-in function array_is_list
and the polyfil is very inefficient for most cases. Yes, the current implementation is very efficient for true lists, but has very bad performance with any other list, e.g. the one from the previous PR.
The current implementation would benefit from a very simple optimization: foreach (array_keys($array) as $k) {
but no sense in doing this if we can achieve an overall better performance with just array_keys
.
The current implementation builds a new array in memory. This is super efficient if the array was built like this range(1, 1000)
. But if the array is large and contains other arrays or objects then building a copy of it is very bad. So we need to get rid of array_values()
. This also solves the issue from previous PR because we are no longer comparing the values.
This is the most efficient and the most correct implementation I could find.
Fixes #18296. We are only interested in the execution time of the user queries. All queries in Tracker are executed via control user.
Thanks. This is caused by #18280
Improve types for range()
Improve types for range()
This is based on the new RFC https://wiki.php.net/rfc/proper-range-semantics
While the RFC is only in discussion phase, SA should already pick up these issues. Regardless of the final status of RFC, there should be no negative or 0 step values, and start/end should be string|float|int. While resources, arrays and objects are accepted, this is NOT the documented functionality. Using it is currently relying on implementation detail and is undefined behaviour. We can also promise that the return value is non-empty-array because the end is inclusive. This means that range(1, 1)
will return [1]
, and an empty array will only be returned if we use exotic values that break the algorithm, e.g. NAN.
@MauricioFauth This can be merged now.
Pending reply to https://github.com/slevomat/coding-standard/issues/1526
Pending reply to https://github.com/slevomat/coding-standard/issues/1526
Update DbiDummy.php
Signed-off-by: Kamil Tekiela tekiela246@gmail.com
Fixes #18290