1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-10 17:55:39 +02:00

Bug 305118: Add include for relative inclusion from different folder.

This commit is contained in:
Markus Schorn 2010-03-15 13:41:02 +00:00
parent e5da8307a0
commit 05957c8002

View file

@ -548,26 +548,25 @@ public class AddIncludeOnSelectionAction extends TextEditorAction {
}
}
}
if (k == 0) {
return null;
}
Arrays.sort(ballotBox, 0, k);
String contender = ballotBox[0];
int votes = 1;
String winner = contender;
int winnerVotes = votes;
for (int i = 1; i < k; i++) {
if (!ballotBox[i].equals(contender)) {
contender = ballotBox[i];
votes = 1;
}
votes++;
if (votes > winnerVotes) {
winner = contender;
winnerVotes = votes;
if (k != 0) {
Arrays.sort(ballotBox, 0, k);
String contender = ballotBox[0];
int votes = 1;
String winner = contender;
int winnerVotes = votes;
for (int i = 1; i < k; i++) {
if (!ballotBox[i].equals(contender)) {
contender = ballotBox[i];
votes = 1;
}
votes++;
if (votes > winnerVotes) {
winner = contender;
winnerVotes = votes;
}
}
return new RequiredInclude(winner, systemIncludeVotes * 2 >= k);
}
return new RequiredInclude(winner, systemIncludeVotes * 2 >= k);
}
// The file has never been included before.