< prev index next >
src/hotspot/share/logging/logOutput.cpp
Print this page
rev 50985 : 8206977: Minor improvements of runtime code.
Reviewed-by: coleenp, lfoltan
*** 260,270 ****
// Reduce deviates greedily, using the "best" selection at each step to reduce the number of deviating tag sets
while (n_deviates > 0) {
size_t prev_deviates = n_deviates;
int max_score = 0;
! const LogSelection* best_selection = NULL;
for (size_t i = 0; i < n_selections; i++) {
// Give the selection a score based on how many deviating tag sets it selects (with correct level)
int score = 0;
for (size_t d = 0; d < n_deviates; d++) {
--- 260,272 ----
// Reduce deviates greedily, using the "best" selection at each step to reduce the number of deviating tag sets
while (n_deviates > 0) {
size_t prev_deviates = n_deviates;
int max_score = 0;
!
! guarantee(n_selections > 0, "Cannot find maximal selection.");
! const LogSelection* best_selection = &selections[0];
for (size_t i = 0; i < n_selections; i++) {
// Give the selection a score based on how many deviating tag sets it selects (with correct level)
int score = 0;
for (size_t d = 0; d < n_deviates; d++) {
*** 285,301 ****
}
}
// Pick the selection with the best score, or in the case of a tie, the one with fewest tags
if (score > max_score ||
! (score == max_score && best_selection != NULL && selections[i].ntags() < best_selection->ntags())) {
max_score = score;
best_selection = &selections[i];
}
}
- assert(best_selection != NULL, "must always find a maximal selection");
add_to_config_string(*best_selection);
// Remove all deviates that this selection covered
for (size_t d = 0; d < n_deviates;) {
if (deviates[d]->level_for(this) == best_selection->level() && best_selection->selects(*deviates[d])) {
--- 287,302 ----
}
}
// Pick the selection with the best score, or in the case of a tie, the one with fewest tags
if (score > max_score ||
! (score == max_score && selections[i].ntags() < best_selection->ntags())) {
max_score = score;
best_selection = &selections[i];
}
}
add_to_config_string(*best_selection);
// Remove all deviates that this selection covered
for (size_t d = 0; d < n_deviates;) {
if (deviates[d]->level_for(this) == best_selection->level() && best_selection->selects(*deviates[d])) {
< prev index next >