Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Stats.cc
r185 r202 123 123 else if (lt == Parser::comment) 124 124 ++(*comments)[rev]; 125 126 std::vector<u_int>* empty = &(empty_[user]); 127 if (empty->size() < rev+1){ 128 empty->reserve(revision_ + 1); 129 empty->insert(empty->end(), rev - empty->size(), 0); 130 if (lt == Parser::comment) 131 empty->push_back(1); 132 else 133 empty->push_back(0); 134 } 135 else if (lt == Parser::comment) 136 ++(*empty)[rev]; 125 137 } 126 138 … … 140 152 ++count; 141 153 } 154 142 155 } 143 156 … … 210 223 } 211 224 225 for (MapConstIter_ o_i= other.empty_.begin(); 226 o_i != other.empty_.end(); ++o_i) 227 { 228 std::pair<MapIter_,bool> result = empty_.insert(*o_i); 229 if (!result.second) 230 empty_[(*(result.first)).first] = 231 VectorPlus<u_int>()( (*(result.first)).second, (*o_i).second ); 232 233 } 234 212 235 for (MapConstIter_ o_i= other.total_.begin(); 213 236 o_i != other.total_.end(); ++o_i) -
trunk/lib/Stats.h
r198 r202 77 77 78 78 /// 79 /// 80 /// 81 inline u_int empty(void) const { return accumulated(empty_).back(); } 82 83 /// 84 /// 85 /// 86 inline u_int empty(const std::string& user) const 87 { return accumulated(empty_, user).back(); } 88 89 /// 79 90 /// 80 91 /// … … 92 103 /// 93 104 inline void reset(void) 94 { code_.clear(); comments_.clear(); total_.clear(); authors_.clear();} 105 { 106 code_.clear(); comments_.clear(); empty_.clear(); total_.clear(); 107 authors_.clear();} 95 108 96 109 /// … … 156 169 Map_ code_; 157 170 Map_ comments_; 171 Map_ empty_; 158 172 Map_ total_; 159 173 };
Note: See TracChangeset
for help on using the changeset viewer.