[Debtags-commits] [svn] r1813 - in debtags/1.6.0: . tools
Enrico Zini
enrico at costa.debian.org
Sat Jul 8 06:54:25 UTC 2006
Author: enrico
Date: Sat Jul 8 06:54:16 2006
New Revision: 1813
Modified:
debtags/1.6.0/ (props changed)
debtags/1.6.0/tools/debtags.cc
Log:
r2995 at viaza: enrico | 2006-07-08 00:12:53 +0200
Solved sefgault, fixed ordering by discriminance
Modified: debtags/1.6.0/tools/debtags.cc
==============================================================================
--- debtags/1.6.0/tools/debtags.cc (original)
+++ debtags/1.6.0/tools/debtags.cc Sat Jul 8 06:54:16 2006
@@ -752,7 +752,7 @@
bool operator()(const Tag& t1, const Tag& t2)
{
// Returns true if t1 precedes t2, and false otherwise
- return abs(itemCount / 2 - metric.get(t1)) < abs(itemCount / 2 - metric.get(t2));
+ return abs(itemCount / 2 - metric.get(t2)) < abs(itemCount / 2 - metric.get(t1));
}
};
@@ -980,7 +980,7 @@
wanted.insert(tags[i]);
// Get the next userCount packages as interesting
- for (size_t i = tags.size() - autoCount; i >= tags.size() - autoCount - userCount; --i)
+ for (size_t i = tags.size() - autoCount - 1; i >= tags.size() - autoCount - userCount; --i)
interesting.push_back(tags[i]);
}
@@ -1005,18 +1005,18 @@
++idx;
}
- for (std::set<Tag>::const_iterator i = ignored.begin();
- i != ignored.end(); ++i)
+ for (std::vector<Tag>::const_iterator i = interesting.begin();
+ i != interesting.end(); ++i)
{
- cout << idx << ") " << i->fullname() << " (ignored)" << endl;
+ cout << idx << ") " << i->fullname() << endl;
tagsInMenu.push_back(*i);
++idx;
}
- for (std::vector<Tag>::const_iterator i = interesting.begin();
- i != interesting.end(); ++i)
+ for (std::set<Tag>::const_iterator i = ignored.begin();
+ i != ignored.end(); ++i)
{
- cout << idx << ") " << i->fullname() << endl;
+ cout << idx << ") " << i->fullname() << " (ignored)" << endl;
tagsInMenu.push_back(*i);
++idx;
}
@@ -1058,8 +1058,8 @@
//metrics2.dump("AFT ", cout);
//jumps.dump("JMP ", cout);
- //autoSelect(tags, 1);
- autoSelect(tags, 0);
+ autoSelect(tags, 1);
+ //autoSelect(tags, 0);
}
#if 0
@@ -1102,7 +1102,7 @@
badAnswer = true;
else if (ans[0] == '+') {
int idx = strtoul(ans.substr(1).c_str(), NULL, 10);
- if (idx < 0 || idx >= tagsInMenu.size())
+ if (idx < 0 || (unsigned)idx >= tagsInMenu.size())
badAnswer = true;
else
{
@@ -1115,7 +1115,7 @@
}
} else if (ans[0] == '-') {
int idx = strtoul(ans.substr(1).c_str(), NULL, 10);
- if (idx < 0 || idx >= tagsInMenu.size())
+ if (idx < 0 || (unsigned)idx >= tagsInMenu.size())
badAnswer = true;
else
{
@@ -1128,7 +1128,7 @@
}
} else if (ans[0] == '=') {
int idx = strtoul(ans.substr(1).c_str(), NULL, 10);
- if (idx < 0 || idx >= tagsInMenu.size())
+ if (idx < 0 || (unsigned)idx >= tagsInMenu.size())
badAnswer = true;
else
{
More information about the Debtags-commits
mailing list