Fix warnings about updating empty maps
This commit is contained in:
+1
-1
@@ -61,7 +61,6 @@ public class FullDataPointIdMap
|
||||
private static final String BLOCK_STATE_SEPARATOR_STRING = "_DH-BSW_";
|
||||
|
||||
|
||||
// FIXME: Improve performance maybe?
|
||||
/** used when the data point map is running normally */
|
||||
private final ReentrantReadWriteLock readWriteLock = new ReentrantReadWriteLock();
|
||||
|
||||
@@ -118,6 +117,7 @@ public class FullDataPointIdMap
|
||||
|
||||
/** @return -1 if the list is empty */
|
||||
public int getMaxValidId() { return this.entryList.size() - 1; }
|
||||
public boolean isEmpty() { return this.entryList.isEmpty(); }
|
||||
|
||||
public DhSectionPos getPos() { return this.pos; }
|
||||
|
||||
|
||||
+7
@@ -223,6 +223,13 @@ public class FullDataSourceV2 implements IDataSource<IDhLevel>
|
||||
public boolean update(@NotNull FullDataSourceV2 inputDataSource, @Nullable IDhLevel level) { return this.update(inputDataSource); }
|
||||
public boolean update(@NotNull FullDataSourceV2 inputDataSource)
|
||||
{
|
||||
// don't try updating if the input is empty
|
||||
if (inputDataSource.mapping.isEmpty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
byte thisDetailLevel = this.pos.getDetailLevel();
|
||||
byte inputDetailLevel = inputDataSource.pos.getDetailLevel();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user