tchristofferson / Config-Updater

Used to update files for Bukkit/Spigot API
MIT License
67 stars 9 forks source link

Make smaller improvments #32

Closed broken1arrow closed 1 year ago

broken1arrow commented 1 year ago

I made the code easier to read and also facilitated testing different parts by breaking it down into smaller methods. This is just the first of many planned changes, but I won't make too many alterations until I hear your viewpoint on this.

tchristofferson commented 1 year ago

I requested some minor changes.

Does this fix any existing bugs? If it does could you please make a reference to them here?

broken1arrow commented 1 year ago

I requested some minor changes.

Does this fix any existing bugs? If it does could you please make a reference to them here?

This is more fix so it is more easy to read the code, so you don't have loops that are 100 lines long.

I'm also looking on the bug, when key is null. But that is more complicated, because #config.getKey() ignore sections some don't have values set.

The only fix right now, is to have set something in the original config, it's not a problem if the key on the disk don't have value set. I know someone suggested to catch the error, but it's not so easy to solve that problem.

broken1arrow commented 1 year ago

Could perhaps improve the loop for the ignored values even more, will check that later on.