https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41162

David Cook <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #1 from David Cook <[email protected]> ---
Nice spot, Philip. 

This is a tricky one. 

I hoped that maybe checking the size of the array created by ($from .. $to)
would be enough, but it turns out that ($from .. $to) is a very heavy CPU and
RAM intensive operation itself when using the values 100101224 and 1000101274. 

On the face of it, we could minus $to from $from to get a difference to try to
validate, but... I think barcodes are not necessarily positive integers. The
".." Perl range operator also has a magical auto-increment algorithm when
applied to strings, so it might be difficult to take into account that magic...

That being said... if you put $from = 'ax' and increment is with $from++,
you'll get 'ay' same as when using the ".." range operator.

So using a for loop with ++ increment operator and a max count might work. That
should have a number of advantages in terms of CPU and RAM usage actually since
the calculation should be quite stable. 

We'd also want another variable to test the last generated value, because
something like: "from *x to az" will only yield *x, so you wouldn't want to
increment 10000 times and get *x for each iteration.

Anyway... perhaps not a perfect solution but hopefully it would be practical?

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to