diff --git a/lib/library.h b/lib/library.h index 8dd6388da..743f32c09 100644 --- a/lib/library.h +++ b/lib/library.h @@ -301,6 +301,8 @@ private: }; class CodeBlock { public: + CodeBlock() : _offset(0) {} + void setStart(const std::string& s) { _start = s; } @@ -311,7 +313,7 @@ private: _offset = o; } void addBlock(const std::string& blockName) { - _blocks.push_back(blockName); + _blocks.insert(blockName); } std::string start() const { return _start; @@ -323,15 +325,14 @@ private: return _offset; } bool isBlock(const std::string& blockName) const { - return std::find(_blocks.begin(), _blocks.end(), blockName) - != _blocks.end(); + return _blocks.find(blockName) != _blocks.end(); } private: std::string _start; std::string _end; int _offset; - std::list _blocks; + std::set _blocks; }; int allocid; std::map _alloc; // allocation functions