java - Call to 'substring' is redundant - Stack Overflow
IntelliJ IDEA, Jetbrains' Java IDE
IntelliJ IDEA 2024.2 users - update your IDE
IntelliJ IDEA 13.1 is painfully slow
You could try asking on r/IntelliJIDEA (shameless plug).
Have you tried building your project in Eclipse or directly with javac from Command Prompt? It might not be IDEA's fault, and it doesn't sound like it would be.
Check your project settings for extra dependencies that might have gotten imported accidentally.
Java compilation is definitely I/O bound. If your hard drive is slow or you need to search for and load in a lot of JARs, then it's going to drive up your build time. It could be simply that you need to defragment your hard drive.
More on reddit.comYou can simplify the call to this:
sb.append(equation, i + 1, right);
This avoids an explicit intermediate string construction, allowing the implementation to copy the desired part of "equation" directly.
That's because StringBuilder append is overlaoded with a function, that also takes start and end index like substring.
So instead of using
sb.append(equation.substring(i + 1, right));
you can just use
sb.append(equation, i + 1, right);