From 7137414a547ad2a03212235b30c1ef914e99e135 Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Thu, 21 May 2020 13:58:04 +0200 Subject: [PATCH] Refactoring --- src/main/java/w2phtml/rdf/DocumentPart.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/w2phtml/rdf/DocumentPart.java b/src/main/java/w2phtml/rdf/DocumentPart.java index 46ec8dd..d05e839 100644 --- a/src/main/java/w2phtml/rdf/DocumentPart.java +++ b/src/main/java/w2phtml/rdf/DocumentPart.java @@ -65,13 +65,12 @@ public class DocumentPart { if (metaElements.hasAttribute("name") && metaElements.hasAttribute("content")) { String metaName = metaElements.getAttribute("name"); String metaValue = metaElements.getAttribute("content"); - if (metadata.containsKey(metaName)) { - metadata.get(metaName).add(metaValue); - } else { + if (!metadata.containsKey(metaName)) { Set names = new HashSet(); - names.add(metaValue); metadata.put(metaName, names); } + Set names = metadata.get(metaName); + names.add(metaValue); } } }