felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stuart McCulloch" <stuart.mccull...@jayway.net>
Subject Re: svn commit: r647612 - in /felix/trunk/framework/src/main/java/org/apache/felix/framework: FilterImpl.java util/ldap/Parser.java
Date Mon, 14 Apr 2008 03:53:11 GMT
On 14/04/2008, pauls@apache.org <pauls@apache.org> wrote:
>
> Author: pauls
> Date: Sun Apr 13 12:10:39 2008
> New Revision: 647612
>
> URL: http://svn.apache.org/viewvc?rev=647612&view=rev
> Log:
> Cache filters and create an index for objectclass to improve service
> lookup performance.
>
> Modified:
>
>     felix/trunk/framework/src/main/java/org/apache/felix/framework/FilterImpl.java
>
>     felix/trunk/framework/src/main/java/org/apache/felix/framework/util/ldap/Parser.java
>
> Modified:
> felix/trunk/framework/src/main/java/org/apache/felix/framework/util/ldap/Parser.java
> URL:
> http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/ldap/Parser.java?rev=647612&r1=647611&r2=647612&view=diff
>
> ==============================================================================
> ---
> felix/trunk/framework/src/main/java/org/apache/felix/framework/util/ldap/Parser.java
> (original)
> +++
> felix/trunk/framework/src/main/java/org/apache/felix/framework/util/ldap/Parser.java
> Sun Apr 13 12:10:39 2008
> @@ -257,6 +257,11 @@
>          switch (kind)
>          {
>              case SIMPLE :
> +                if ("objectClass".equals(attr.toString()) && (op == '='))
> +                {
> +                    program.add(new ObjectClassOperator((String)
> pieces.get(0)));
> +                    return true;
> +                }
>                  // Code: Push(attr); Constant(pieces.get(0));
> <operator>();
>                  program.add(new PushOperator(attr.toString()));
>                  program.add(new ConstOperator(pieces.get(0)));


this is a little bit faster, as it short-circuits the check on other ops:

   if ((op == '=') && "objectClass".equalsIgnoreCase(attr.toString()))

also I think it should be equalsIgnoreCase because the attribute is
case-insensitve? or is this normalized elsewhere to "objectClass"?

-- 
Cheers, Stuart

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message