Add menu item only if it hasn't been add before
Hey guys :).
I have a .ini file. I parse the lines, and add a menu items. But I want where it duplicates not to add, and just skip it. Any ideas? |
Re: Add menu item only if it hasn't been add before
hook trough all lines, and check isn't the line equal to any other line. if yes, just skip it with continue;
|
Re: Add menu item only if it hasn't been add before
Quote:
|
Re: Add menu item only if it hasn't been add before
Create a Trie before you parse the file, add any new item in the Trie if the key doesn't already exist, else don't create a new item.
When you have finished you can destroy the trie. |
| All times are GMT -4. The time now is 04:28. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.