Replace unneeded Function with imperative approach

The latter is more concise, faster, and compact.  .class size in bytes
before:

LocalAsyncBlobStore$5.class      1883
LocalAsyncBlobStore.class       20743

and after:

LocalAsyncBlobStore.class       21041
This commit is contained in:
Andrew Gaul 2013-02-05 10:01:50 -08:00
parent 89fda8ee28
commit 3734fe8100
1 changed files with 6 additions and 9 deletions

View File

@ -191,15 +191,12 @@ public class LocalAsyncBlobStore extends BaseAsyncBlobStore {
contents = newTreeSet(filter(contents, new DelimiterFilter(prefix, delimiter)));
Iterables.<StorageMetadata> addAll(contents, transform(commonPrefixes,
new Function<String, StorageMetadata>() {
public StorageMetadata apply(String o) {
MutableStorageMetadata md = new MutableStorageMetadataImpl();
md.setType(StorageType.RELATIVE_PATH);
md.setName(o);
return md;
}
}));
for (String o : commonPrefixes) {
MutableStorageMetadata md = new MutableStorageMetadataImpl();
md.setType(StorageType.RELATIVE_PATH);
md.setName(o);
contents.add(md);
}
}
// trim metadata, if the response isn't supposed to be detailed.