Insomniumm / bwsal

Automatically exported from code.google.com/p/bwsal
0 stars 0 forks source link

Base:getMinerals() should return reference #30

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago

BWSAL::Base::getMinerals() and getGaseysers() are currently

std::set<BWAPI::Unit *> getMinerals() const;

but for efficiency's sake, this should probably be

const std::set<BWAPI::Unit *> & getMinerals() const;

since BWTA::BaseLocation::getMinerals() returns a reference to a set. Not 
returning a reference calls the copy constructor every time the method is 
called and is pretty inefficient.

Original issue reported on code.google.com by dave.chu...@gmail.com on 25 Oct 2010 at 8:26

GoogleCodeExporter commented 8 years ago
Fixed in r482.

Original comment by lowerlo...@gmail.com on 27 Jul 2011 at 2:09

GoogleCodeExporter commented 8 years ago

Original comment by lowerlo...@gmail.com on 27 Jul 2011 at 2:09