1. Fix EDKT230 "A library class should not be specified for a module more than one time"

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1460 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
hche10x 2006-09-05 06:51:14 +00:00
parent c757cb321c
commit 90bed2f7ff
1 changed files with 4 additions and 7 deletions

View File

@ -21,12 +21,7 @@ public class LibraryClassVector {
private Vector<LibraryClassIdentification> vLibraryClass = new Vector<LibraryClassIdentification>(); private Vector<LibraryClassIdentification> vLibraryClass = new Vector<LibraryClassIdentification>();
public int findLibraryClass(LibraryClassIdentification lib) { public int findLibraryClass(LibraryClassIdentification lib) {
for (int index = 0; index < vLibraryClass.size(); index++) { return findLibraryClass(lib.getLibraryClassName());
if (vLibraryClass.elementAt(index).equals(lib)) {
return index;
}
}
return -1;
} }
public int findLibraryClass(String name) { public int findLibraryClass(String name) {
@ -47,7 +42,9 @@ public class LibraryClassVector {
} }
public void addLibraryClass(LibraryClassIdentification lib) { public void addLibraryClass(LibraryClassIdentification lib) {
vLibraryClass.addElement(lib); if (findLibraryClass(lib) == -1) {
vLibraryClass.addElement(lib);
}
} }
public void setLibraryClass(LibraryClassIdentification lib, int index) { public void setLibraryClass(LibraryClassIdentification lib, int index) {