From ad51edcb07a1d164c4b94fdb7c538d9c7369293b Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Sat, 18 Jan 2020 11:40:38 +0100 Subject: [PATCH] Optimized code. --- src/fr/devinsy/xidyn/data/TagDataManager.java | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/fr/devinsy/xidyn/data/TagDataManager.java b/src/fr/devinsy/xidyn/data/TagDataManager.java index 81c5c64..ed50eb4 100644 --- a/src/fr/devinsy/xidyn/data/TagDataManager.java +++ b/src/fr/devinsy/xidyn/data/TagDataManager.java @@ -293,9 +293,8 @@ public class TagDataManager if (result == null) { - this.idsDataById.setId(id, new SimpleTagData()); - - result = (SimpleTagData) this.idsDataById.getId(id); + result = new SimpleTagData(); + this.idsDataById.setId(id, result); } // @@ -319,9 +318,8 @@ public class TagDataManager TagDataListByIndex tags = (TagDataListByIndex) this.idsDataById.getId(id); if (tags == null) { - this.idsDataById.setId(id, new TagDataListByIndex()); - - tags = (TagDataListByIndex) this.idsDataById.getId(id); + tags = new TagDataListByIndex(); + this.idsDataById.setId(id, tags); } // Be sure that lines are existing. @@ -357,9 +355,8 @@ public class TagDataManager TagDataListByIndex tags = (TagDataListByIndex) this.idsDataById.getId(id); if (tags == null) { - this.idsDataById.setId(id, new TagDataListByIndex()); - - tags = (TagDataListByIndex) this.idsDataById.getId(id); + tags = new TagDataListByIndex(); + this.idsDataById.setId(id, tags); } // Be sure that lines are existing. @@ -376,9 +373,8 @@ public class TagDataManager if (result == null) { - lineData.put(column, new SimpleTagData()); - - result = (SimpleTagData) lineData.get(column); + result = new SimpleTagData(); + lineData.put(column, result); } //