small optim as no need to continue querying here

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1580721 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2014-03-24 03:18:00 +00:00
parent 8565793eed
commit 6f73874474

View File

@ -1847,9 +1847,6 @@ public void removeArtifact( final String repositoryId, final String namespace, f
new ArtifactMetadataModel.KeyBuilder().withRepositoryId( repositoryId ).withNamespace( namespace ).withId(
id ).withProjectVersion( version ).withProject( project ).build();
Keyspace keyspace = cassandraArchivaManager.getKeyspace();
this.artifactMetadataTemplate.deleteRow( key );
key =
@ -1858,6 +1855,7 @@ public void removeArtifact( final String repositoryId, final String namespace, f
this.projectVersionMetadataModelTemplate.deleteRow( key );
}
@Override
@ -2019,9 +2017,14 @@ public Collection<ArtifactMetadata> getArtifacts( final String repoId, final Str
.addEqualsExpression( "projectVersion", projectVersion ) //
.execute();
if (result.get() == null || result.get().getCount() < 1)
{
return Collections.emptyList();
}
List<ArtifactMetadata> artifactMetadatas = new ArrayList<ArtifactMetadata>( result.get().getCount() );
LongSerializer ls = LongSerializer.get();
for ( Row<String, String, String> row : result.get() )
{