refactor: simplify while loop logic

- Replace `removeFirst()` check with `isEmpty()` for cleaner loop condition.
- Improve code readability and maintainability.

Signed-off-by: Minecon724 <git@m724.eu>
This commit is contained in:
Minecon724 2025-02-08 15:55:40 +01:00
parent 8e4fae069d
commit 0a6d8c09c5
Signed by: Minecon724
GPG key ID: 3CCC4D267742C8E8

View file

@ -60,8 +60,8 @@ public record Post(
var properties = new HashMap<String, String>(); var properties = new HashMap<String, String>();
String line; while (!lines.isEmpty()) {
while ((line = lines.removeFirst()) != null) { var line = lines.removeFirst();
var parts = line.split(" "); var parts = line.split(" ");
var key = parts[0].toLowerCase(); var key = parts[0].toLowerCase();