Details
-
Task
-
Status: Closed
-
Trivial
-
Resolution: Won't Fix
-
None
-
None
-
None
-
None
Description
The following code is from HColumnDescriptor#convert() but the pattern can be found in other classes, such as HBaseAdmin:
for (Map.Entry<String, String> e : this.configuration.entrySet()) { NameStringPair.Builder aBuilder = NameStringPair.newBuilder(); aBuilder.setName(e.getKey()); aBuilder.setValue(e.getValue()); builder.addConfiguration(aBuilder.build()); }
NameStringPair.Builder instance can be reused across iterations of the loop.
This would save creation of short-lived objects.