You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
INI file data is currently parsed from the file contents every time GetValue(), SetValue(), GetSections(), or GetKeys() is called. Further, SetValue() completely rewrites portions of the file contents every time it is called. This is inefficient.
Instead, string parsing and manipulation should only occur when absolutely necessary: during loading and saving of the INI file. When the INI file is loaded, the string contents of the file should be parsed and loaded into data structures to represent the file's contents. When the INI file is saved, the data structures should be converted back into a string for persistence.
It would be much more efficient to look up sections and keys, add new sections and keys, or replace existing keys in a section, if they were all contained in collections, which can be indexed (for example, by using nested Dictionary objects).
The text was updated successfully, but these errors were encountered:
INI file data is currently parsed from the file contents every time
GetValue()
,SetValue()
,GetSections()
, orGetKeys()
is called. Further,SetValue()
completely rewrites portions of the file contents every time it is called. This is inefficient.Instead, string parsing and manipulation should only occur when absolutely necessary: during loading and saving of the INI file. When the INI file is loaded, the string contents of the file should be parsed and loaded into data structures to represent the file's contents. When the INI file is saved, the data structures should be converted back into a string for persistence.
It would be much more efficient to look up sections and keys, add new sections and keys, or replace existing keys in a section, if they were all contained in collections, which can be indexed (for example, by using nested
Dictionary
objects).The text was updated successfully, but these errors were encountered: