Skip to content

Commit

Permalink
Reorder tag type checks based on Github frequency
Browse files Browse the repository at this point in the history
  • Loading branch information
PseudoKnight committed Sep 17, 2023
1 parent 0207a81 commit 0099210
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,29 @@ public Collection getKeys() {
@Override
public MCTagType getType(Object key) {
NamespacedKey namespacedKey = GetNamespacedKey(key);
// Check tag types in order of most frequently used
if(pdc.has(namespacedKey, PersistentDataType.STRING)) {
return MCTagType.STRING;
} else if(pdc.has(namespacedKey, PersistentDataType.BYTE)) {
return MCTagType.BYTE;
} else if(pdc.has(namespacedKey, PersistentDataType.SHORT)) {
return MCTagType.SHORT;
} else if(pdc.has(namespacedKey, PersistentDataType.INTEGER)) {
return MCTagType.INTEGER;
} else if(pdc.has(namespacedKey, PersistentDataType.BYTE)) {
return MCTagType.BYTE;
} else if(pdc.has(namespacedKey, PersistentDataType.DOUBLE)) {
return MCTagType.DOUBLE;
} else if(pdc.has(namespacedKey, PersistentDataType.LONG)) {
return MCTagType.LONG;
} else if(pdc.has(namespacedKey, PersistentDataType.FLOAT)) {
return MCTagType.FLOAT;
} else if(pdc.has(namespacedKey, PersistentDataType.DOUBLE)) {
return MCTagType.DOUBLE;
} else if(pdc.has(namespacedKey, PersistentDataType.TAG_CONTAINER)) {
return MCTagType.TAG_CONTAINER;
} else if(pdc.has(namespacedKey, PersistentDataType.BYTE_ARRAY)) {
return MCTagType.BYTE_ARRAY;
} else if(pdc.has(namespacedKey, PersistentDataType.SHORT)) {
return MCTagType.SHORT;
} else if(pdc.has(namespacedKey, PersistentDataType.INTEGER_ARRAY)) {
return MCTagType.INTEGER_ARRAY;
} else if(pdc.has(namespacedKey, PersistentDataType.LONG_ARRAY)) {
return MCTagType.LONG_ARRAY;
} else if(pdc.has(namespacedKey, PersistentDataType.TAG_CONTAINER)) {
return MCTagType.TAG_CONTAINER;
} else if(pdc.has(namespacedKey, PersistentDataType.TAG_CONTAINER_ARRAY)) {
return MCTagType.TAG_CONTAINER_ARRAY;
}
Expand Down

0 comments on commit 0099210

Please sign in to comment.