Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8233597

Clean up code in G1Analytics::compute_pause_time_ratio

XMLWordPrintable

    • gc
    • b25

      In G1Analytics::compute_pause_time_ratio() there is this code:

        if (_recent_avg_pause_time_ratio < 0.0 ||
            (_recent_avg_pause_time_ratio - 1.0 > 0.0)) {
          // Clip ratio between 0.0 and 1.0, and continue. This will be fixed in
          // CR 6902692 by redoing the manner in which the ratio is incrementally computed.
          if (_recent_avg_pause_time_ratio < 0.0) {
            _recent_avg_pause_time_ratio = 0.0;
          } else {
            assert(_recent_avg_pause_time_ratio - 1.0 > 0.0, "Ctl-point invariant");
            _recent_avg_pause_time_ratio = 1.0;
          }
        }

      that could be simplified using MIN/MAX methods or the clamp() method introduced by JDK-8233702

            tschatzl Thomas Schatzl
            tschatzl Thomas Schatzl
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: