Skip to content

Commit e684a16

Browse files
committed
Avoid extra tVideoResolution::tVideoResolutionCompare subclass
1 parent c989378 commit e684a16

2 files changed

Lines changed: 4 additions & 11 deletions

File tree

Descent3/config.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ void ConfigureDisplayResolutions() {
353353
return;
354354
}
355355

356-
std::set<tVideoResolution, tVideoResolution::tVideoResolutionCompare> resolutions;
356+
std::set<tVideoResolution> resolutions;
357357
for (int d = 0; d < display_count; d++) {
358358
SDL_DisplayID display_id = displays[d];
359359

Descent3/config.h

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -149,17 +149,10 @@ struct tVideoResolution
149149
return other.width == this->width && other.height == this->height;
150150
}
151151

152-
struct tVideoResolutionCompare
152+
bool operator<(const tVideoResolution& other) const
153153
{
154-
bool operator()(const tVideoResolution &lres, const tVideoResolution &rres) const
155-
{
156-
if (lres.width != rres.width)
157-
{
158-
return lres.width < rres.width;
159-
}
160-
return lres.height < rres.height;
161-
}
162-
};
154+
return width != other.width ? width < other.width : height < other.height;
155+
}
163156
};
164157

165158
extern std::vector<tVideoResolution> Video_res_list;

0 commit comments

Comments
 (0)