[emt] r218 committed - Trivial optimization. Break out of the loop if f->values is empty. Do ...

1 view
Skip to first unread message

e...@googlecode.com

unread,
Apr 13, 2011, 3:36:01 PM4/13/11
to emt...@googlegroups.com
Revision: 218
Author: akirarat
Date: Wed Apr 13 12:35:43 2011
Log: Trivial optimization. Break out of the loop if f->values is
empty. Do not continue to the foreach loop, because it is a waste of time.


http://code.google.com/p/emt/source/detail?r=218

Modified:
/trunk/bin/emt_gather

=======================================
--- /trunk/bin/emt_gather Fri Oct 8 10:14:42 2010
+++ /trunk/bin/emt_gather Wed Apr 13 12:35:43 2011
@@ -211,6 +211,12 @@

if ($f->multi_value)
{
+ if (!count($f->values))
+ {
+ log_error("All sub_names were unset from field
{$f->name}. This field will not be passed to any output handler.");
+ continue;
+ }
+
foreach ($f->values as $key => $value)
{
if (!preg_match('/[a-zA-Z0-9]/', $key))
@@ -225,12 +231,6 @@
unset($f->values[$key]);
}
}
-
- if (!count($f->values))
- {
- log_error("All sub_names were unset from field
{$f->name}. This field will not be passed to any output handler.");
- continue;
- }
}
else
{

Reply all
Reply to author
Forward
0 new messages