|
-
September 24th, 2009, 05:56 PM
#15
Re: Need advice - what to use CStringArray or CStringList
 Originally Posted by ahmd
What happens is that first it goes really fast but then it literally slows down to a crawl (probably due to constant memory reallocations of the dynamic array.) The file search, I believe is cached by the OS so the second pass runs very fast.
CArray can have that problem (altough 1000 seems very small for that
to happen). a std::vector will not run in to that difficulty nearly as much.
To prevent re-allocations, a CList or std:: list or std: eque could be
used.
When I asked : for each tag ... a list of files that have that tag ?
you answered : If I find that the tag matches I'm updating the file that this tag is in and save it back to disc.
So does this mean at some point, you are given a tag ... you need to
find ALL files that have that tag ? If so, then the following should work:
std::map< CString , list<CString> > (or similar MFC)
where the key is the tag , and the value is a list of files
having that tag.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|