ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/iom.h
(Generate patch)

Comparing rxvt-unicode/src/iom.h (file contents):
Revision 1.15 by root, Thu Sep 2 07:44:40 2004 UTC vs.
Revision 1.20 by root, Fri Nov 12 12:43:27 2004 UTC

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
64struct sig_watcher; 64struct sig_watcher;
65#endif 65#endif
66 66
67template<class watcher> 67template<class watcher>
68struct io_manager_vec : vector<watcher *> { 68struct io_manager_vec : vector<watcher *> {
69#if IOM_CHECK
70 bool activity;
71#endif
72
73 void erase_unordered (unsigned int pos) 69 void erase_unordered (unsigned int pos)
74 { 70 {
75 watcher *w = (*this)[this->size () - 1]; 71 watcher *w = (*this)[this->size () - 1];
76 this->pop_back (); 72 this->pop_back ();
77 73
78 if (this->size ()) 74 if (!this->empty ())
79 if ((*this)[pos] = w) 75 if (((*this)[pos] = w)) // '=' is correct!
80 w->active = pos + 1; 76 w->active = pos + 1;
81 } 77 }
82}; 78};
83 79
84// only used as a namespace, and for initialisation purposes 80// only used as a namespace, and for initialisation purposes

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines