renatoh commented on code in PR #4628:
URL: https://github.com/apache/solr/pull/4628#discussion_r3638110306


##########
solr/solrj/src/java/org/apache/solr/common/params/SolrParams.java:
##########
@@ -459,19 +460,17 @@ public NamedList<Object> toNamedList() {
    */
   public String toQueryString() {
     final Charset charset = StandardCharsets.UTF_8;
-    final StringBuilder sb = new StringBuilder(128);
-    boolean first = true;
+
+    var output = new StringJoiner("&", "?", "");

Review Comment:
   Hi @epugh, it has been around for a while, since Java 8, but I have only 
discovered it recently and since then I have been using it quite frequently, it 
saves you exactly  those isFirst checks.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to