From: "Enrico Weigelt, metux IT consult" <[email protected]>
---
src/net/sf/freecol/common/option/ListOption.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/net/sf/freecol/common/option/ListOption.java
b/src/net/sf/freecol/common/option/ListOption.java
index feee2ccf689..6d303dbdead 100644
--- a/src/net/sf/freecol/common/option/ListOption.java
+++ b/src/net/sf/freecol/common/option/ListOption.java
@@ -137,7 +137,11 @@ public abstract class ListOption<T> extends
AbstractOption<List<AbstractOption<T
* @return True if the option can be added.
*/
public boolean canAdd(AbstractOption<T> ao) {
- return (allowDuplicates) ? true : none(value, matchKey(ao));
+ if (!allowDuplicates)
+ for (AbstractOption<T> walk : value)
+ if (walk == ao)
+ return false;
+ return true;
}
--
2.11.0.rc0.7.gbe5a750
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Freecol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freecol-developers