Home » Internationalization » Translation2 » Bug #2563
[PATCH] Admin_DB add/update cleanup
Details
| Request #2563 | [PATCH] Admin_DB add/update cleanup |
|---|---|
| Submitted | 2004-10-18 21:53 UTC |
| From | ieure at php dot net |
| Status | Closed |
| Package | Translation2 |
| PHP Version | 4.3.9 |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2004-10-18 21:53 UTC] ieure at php dot net
Description:
------------
The add() and update() functions in the DB Admin class have
some code which could be optimized further.
They both have what appears to be the same block of code,
which iterates over the passed languages and unset any code
not present in the available list. This is done inside a
foreach loop, which makes repeated calls to in_array().
This has been replaced with a single call to
array_intersect(). count() was also called twice; the
redundant call has been removed.
While I haven't benchmarked my code, I expect that it's
faster than the current version.
Patch is against CVS:
http://atomized.org/PEAR/Patches/Translation2-Admin_DB_AddUpdate_Cleanup.patch