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:
parent
e5da8307a0
commit
05957c8002
1 changed files with 17 additions and 18 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue