From 325694f2762f303c4cf229200d76569be722f36e Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Wed, 18 Apr 2007 15:41:59 +0000
Subject: [PATCH] Make a number of minor changes identified through profiling as potential performance improvements.
---
opends/src/server/org/opends/server/protocols/ldap/LDAPAttribute.java | 31 ++++++++++++++-----------------
1 files changed, 14 insertions(+), 17 deletions(-)
diff --git a/opends/src/server/org/opends/server/protocols/ldap/LDAPAttribute.java b/opends/src/server/org/opends/server/protocols/ldap/LDAPAttribute.java
index 299dbce..9dbec18 100644
--- a/opends/src/server/org/opends/server/protocols/ldap/LDAPAttribute.java
+++ b/opends/src/server/org/opends/server/protocols/ldap/LDAPAttribute.java
@@ -60,9 +60,6 @@
*/
public class LDAPAttribute
{
-
-
-
// The set of values for this attribute.
private ArrayList<ASN1OctetString> values;
@@ -114,14 +111,21 @@
*/
public LDAPAttribute(Attribute attribute)
{
- StringBuilder attrName = new StringBuilder(attribute.getName());
- for (String o : attribute.getOptions())
+ if (attribute.hasOptions())
{
- attrName.append(";");
- attrName.append(o);
- }
+ StringBuilder attrName = new StringBuilder(attribute.getName());
+ for (String o : attribute.getOptions())
+ {
+ attrName.append(";");
+ attrName.append(o);
+ }
- this.attributeType = attrName.toString();
+ this.attributeType = attrName.toString();
+ }
+ else
+ {
+ this.attributeType = attribute.getName();
+ }
LinkedHashSet<AttributeValue> attrValues = attribute.getValues();
if ((attrValues == null) || attrValues.isEmpty())
@@ -192,14 +196,7 @@
}
else
{
- ArrayList<ASN1Element> valueElements =
- new ArrayList<ASN1Element>(values.size());
- for (ASN1OctetString s : values)
- {
- valueElements.add(s);
- }
-
- elements.add(new ASN1Set(valueElements));
+ elements.add(new ASN1Set(new ArrayList<ASN1Element>(values)));
}
return new ASN1Sequence(elements);
--
Gitblit v1.10.0