Lets make a c++ program!
Optimize this:
Why? Do it take what you view as "too long" to run?
Former Microsoft XNA and Xbox MVP | Check out my blog for random ramblings on game development
[quote name='owl' timestamp='1296351082' post='4766869']
Optimize this:
Why? Do it take what you view as "too long" to run?
[/quote]
nope, just for fun and because I know it can be improved a lot. Starting by that miss-paste alnite detected.
One improvement would be to check if "the_list" is empty at the beginning and returning if it is.
[size="2"]I like the Walrus best.
This isn't working. I think it'd be more interesting to post an actual program and then propose changes to optimize it.
Optimize this:
...snip...
Hmm. I choose you, C++ standard library!
std::list<T> output_list;
std::set_difference(the_list.begin(), the_list.end(), erase_list.begin(), erase_list.end(), std::back_inserter(output_list));
the_list.swap(output_list);
erase_list.clear();
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement