LodLive/LodView

optimizing Misc.guessColor

Closed this issue · 1 comments

I think this code

for (String key : conf.getColorPairMatcher().keySet())
{
  for (TripleBean tripleBean : m)
  {
   if (tripleBean.getValue().equals(key))
   {
    colorPair = conf.getColorPairMatcher().get(key);
    return colorPair;
  }
 }
}

can be optimized like this:

for (TripleBean tripleBean : m)
{
 colorPair = conf.getColorPairMatcher().get(tripleBean.getValue());			
 if(colorPair!=null) return colorPair;
}

assuming that the map does not contain null values,

Included in the prefix color feature.