Commit e33b1fa 1 parent 3ed975b commit e33b1fa Copy full SHA for e33b1fa
File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -94,20 +94,21 @@ class EmitMk final {
94
94
= static_cast <double >(topScore + 1 ) / static_cast <int >(intervalsNum);
95
95
96
96
struct Interval final {
97
- int64_t m_lowerBound = 0 ;
97
+ uint64_t m_lowerBound = 0 ;
98
98
int m_size = 0 ;
99
99
};
100
100
101
101
std::vector<Interval> intervals;
102
102
intervals.resize (intervalsNum);
103
103
104
- for (int64_t score = topScore; score >= 0 ; --score) {
105
- const int ivIdx = int ( int64_t ( score) / intervalWidth);
106
- intervals[ivIdx].m_lowerBound = int64_t ( score) ;
104
+ for (uint64_t score = topScore; score >= 1 ; --score) {
105
+ const unsigned int ivIdx = ( unsigned int )( score / intervalWidth);
106
+ intervals[ivIdx].m_lowerBound = score;
107
107
}
108
+ intervals[0 ].m_lowerBound = 0 ;
108
109
109
110
for (const auto score : sortedScores) {
110
- const int ivIdx = int (( score) / intervalWidth);
111
+ const unsigned int ivIdx = ( unsigned int )( score / intervalWidth);
111
112
++intervals[ivIdx].m_size ;
112
113
}
113
114
You can’t perform that action at this time.
0 commit comments