1 | /* |
1 | /* |
2 | iom.h -- generic I/O multiplexor |
2 | iom.h -- generic I/O multiplexer |
3 | Copyright (C) 2003, 2004 Marc Lehmann <pcg@goof.com> |
3 | Copyright (C) 2003, 2004 Marc Lehmann <pcg@goof.com> |
4 | |
4 | |
5 | This program is free software; you can redistribute it and/or modify |
5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by |
6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or |
7 | the Free Software Foundation; either version 2 of the License, or |
… | |
… | |
72 | void erase_unordered (unsigned int pos) |
72 | void erase_unordered (unsigned int pos) |
73 | { |
73 | { |
74 | watcher *w = (*this)[this->size () - 1]; |
74 | watcher *w = (*this)[this->size () - 1]; |
75 | this->pop_back (); |
75 | this->pop_back (); |
76 | |
76 | |
77 | if (this->size ()) |
77 | if (!this->empty ()) |
78 | if (((*this)[pos] = w)) // '=' is correct! |
78 | if (((*this)[pos] = w)) // '=' is correct! |
79 | w->active = pos + 1; |
79 | w->active = pos + 1; |
80 | } |
80 | } |
81 | }; |
81 | }; |
82 | |
82 | |