Remove unnecessary toString() calls
See gh-38739
This commit is contained in:
committed by
Phillip Webb
parent
b6e87cee35
commit
8599e5a986
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -141,7 +141,7 @@ public class Snake {
|
||||
sb.append(',');
|
||||
sb.append(String.format("{x: %d, y: %d}", Integer.valueOf(location.x), Integer.valueOf(location.y)));
|
||||
}
|
||||
return String.format("{'id':%d,'body':[%s]}", Integer.valueOf(this.id), sb.toString());
|
||||
return String.format("{'id':%d,'body':[%s]}", Integer.valueOf(this.id), sb);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -77,7 +77,7 @@ public final class SnakeTimer {
|
||||
sb.append(',');
|
||||
}
|
||||
}
|
||||
broadcast(String.format("{'type': 'update', 'data' : [%s]}", sb.toString()));
|
||||
broadcast(String.format("{'type': 'update', 'data' : [%s]}", sb));
|
||||
}
|
||||
|
||||
public static void broadcast(String message) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -74,7 +74,7 @@ public class SnakeWebSocketHandler extends TextWebSocketHandler {
|
||||
sb.append(',');
|
||||
}
|
||||
}
|
||||
SnakeTimer.broadcast(String.format("{'type': 'join','data':[%s]}", sb.toString()));
|
||||
SnakeTimer.broadcast(String.format("{'type': 'join','data':[%s]}", sb));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -141,7 +141,7 @@ public class Snake {
|
||||
sb.append(',');
|
||||
sb.append(String.format("{x: %d, y: %d}", Integer.valueOf(location.x), Integer.valueOf(location.y)));
|
||||
}
|
||||
return String.format("{'id':%d,'body':[%s]}", Integer.valueOf(this.id), sb.toString());
|
||||
return String.format("{'id':%d,'body':[%s]}", Integer.valueOf(this.id), sb);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -77,7 +77,7 @@ public final class SnakeTimer {
|
||||
sb.append(',');
|
||||
}
|
||||
}
|
||||
broadcast(String.format("{'type': 'update', 'data' : [%s]}", sb.toString()));
|
||||
broadcast(String.format("{'type': 'update', 'data' : [%s]}", sb));
|
||||
}
|
||||
|
||||
public static void broadcast(String message) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -74,7 +74,7 @@ public class SnakeWebSocketHandler extends TextWebSocketHandler {
|
||||
sb.append(',');
|
||||
}
|
||||
}
|
||||
SnakeTimer.broadcast(String.format("{'type': 'join','data':[%s]}", sb.toString()));
|
||||
SnakeTimer.broadcast(String.format("{'type': 'join','data':[%s]}", sb));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -141,7 +141,7 @@ public class Snake {
|
||||
sb.append(',');
|
||||
sb.append(String.format("{x: %d, y: %d}", Integer.valueOf(location.x), Integer.valueOf(location.y)));
|
||||
}
|
||||
return String.format("{'id':%d,'body':[%s]}", Integer.valueOf(this.id), sb.toString());
|
||||
return String.format("{'id':%d,'body':[%s]}", Integer.valueOf(this.id), sb);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -77,7 +77,7 @@ public final class SnakeTimer {
|
||||
sb.append(',');
|
||||
}
|
||||
}
|
||||
broadcast(String.format("{'type': 'update', 'data' : [%s]}", sb.toString()));
|
||||
broadcast(String.format("{'type': 'update', 'data' : [%s]}", sb));
|
||||
}
|
||||
|
||||
public static void broadcast(String message) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -74,7 +74,7 @@ public class SnakeWebSocketHandler extends TextWebSocketHandler {
|
||||
sb.append(',');
|
||||
}
|
||||
}
|
||||
SnakeTimer.broadcast(String.format("{'type': 'join','data':[%s]}", sb.toString()));
|
||||
SnakeTimer.broadcast(String.format("{'type': 'join','data':[%s]}", sb));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user