2019-07-29 02:01:23 +02:00
From a584905bd02b9c01d14a04a69666bb41a80ae1ba Mon Sep 17 00:00:00 2001
2016-05-28 18:34:39 +02:00
From: Techcable <Techcable@techcable.net>
Date: Mon, 25 Apr 2016 23:46:00 -0700
Subject: [PATCH] Reduce the overhead of lots and lots of teams with the same
names
Featherboard (and other bad plugins) use persistent scoreboards (scoreboard.dat), causing every team ever to be sent to waterfall. This is bad, and takes tons of memory.
Uses String.intern() to avoid duplicating strings
diff --git a/api/src/main/java/net/md_5/bungee/api/score/Team.java b/api/src/main/java/net/md_5/bungee/api/score/Team.java
2019-07-29 02:01:23 +02:00
index 849ba1cf..39f81fd1 100644
2016-05-28 18:34:39 +02:00
--- a/api/src/main/java/net/md_5/bungee/api/score/Team.java
+++ b/api/src/main/java/net/md_5/bungee/api/score/Team.java
2019-07-29 02:01:23 +02:00
@@ -29,7 +29,7 @@ public class Team
2016-05-28 18:34:39 +02:00
public void addPlayer(String name)
{
- players.add( name );
+ players.add(name.intern());
}
public void removePlayer(String name)
--
2019-07-29 02:01:23 +02:00
2.22.0
2016-05-28 18:34:39 +02:00