Removed performance hit of logging

Since Java 8, we can use Supplier for logger, which will be evaluated
lazily.

In general, the debug stuff should be removed when we have more
stability.
This commit is contained in:
Tastybento 2018-02-07 19:39:00 -08:00
parent 29d09922b9
commit 1d5086531d

View File

@ -911,8 +911,9 @@ public class MySQLDatabaseHandler<T> extends AbstractDatabaseHandler<T> {
preparedStatement2.setString(1, uniqueId);
preparedStatement2.addBatch();
// Execute
if (DEBUG)
plugin.getLogger().info("DEBUG: " + preparedStatement2.toString());
if (DEBUG) {
plugin.getLogger().info(() -> "DEBUG: " + preparedStatement2.toString()); // Evaluated lazily
}
preparedStatement2.executeBatch();
}
}