[PR #2498] [CLOSED] Refactor GameListFrame Sorting for Improved Modularity and Efficiency #2783

Closed
opened 2026-02-27 22:01:14 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/2498
Author: @colinmendoza121
Created: 2/22/2025
Status: Closed

Base: mainHead: feature


📝 Commits (3)

  • 7d8d6e7 Refactor string comparison helper function for case-insensitive comparison
  • ed09da4 Added CompareStringsCaseInsesitive helper function
  • aab9e5f Moved helper compare strings function above

📊 Changes

1 file changed (+8 additions, -8 deletions)

View changed files

📝 src/qt_gui/game_list_frame.h (+8 -8)

📄 Description

This pull request improves the modularity of the sorting functions in GameListFrame by introducing a helper function to handle case-insensitive string comparisons. Additionally, it optimizes the sorting logic to eliminate unnecessary heap allocations.

Changes:

  • Implemented CompareStringsCaseInsensitive as a dedicated helper function to avoid redundant code in ascending and descending sorting functions.

  • Optimized string comparisons using std::views::transform(::tolower) to prevent unnecessary heap allocations.

  • Updated CompareStringsAscending and CompareStringsDescending to utilize the helper function for cleaner, more maintainable code.

These changes improve code readability, reduce redundancy, and enhance performance when sorting game titles in the emulator’s UI.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/2498 **Author:** [@colinmendoza121](https://github.com/colinmendoza121) **Created:** 2/22/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feature` --- ### 📝 Commits (3) - [`7d8d6e7`](https://github.com/shadps4-emu/shadPS4/commit/7d8d6e7aeb79c885274c383d3f33f93a0e21d998) Refactor string comparison helper function for case-insensitive comparison - [`ed09da4`](https://github.com/shadps4-emu/shadPS4/commit/ed09da49dfb753e8a6347d9b9a85ec725be3f388) Added CompareStringsCaseInsesitive helper function - [`aab9e5f`](https://github.com/shadps4-emu/shadPS4/commit/aab9e5fdad03924636ff3ef0fcb5a538dc5ff780) Moved helper compare strings function above ### 📊 Changes **1 file changed** (+8 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `src/qt_gui/game_list_frame.h` (+8 -8) </details> ### 📄 Description This pull request improves the **modularity** of the sorting functions in GameListFrame by introducing a **helper function** to handle case-insensitive string comparisons. Additionally, it optimizes the sorting logic to eliminate unnecessary heap allocations. Changes: - Implemented **_CompareStringsCaseInsensitive_** as a dedicated helper function to avoid redundant code in ascending and descending sorting functions. - Optimized string comparisons using std::views::transform(::tolower) to prevent unnecessary heap allocations. - Updated CompareStringsAscending and CompareStringsDescending to utilize the helper function for cleaner, more maintainable code. These changes improve code readability, reduce redundancy, and enhance performance when sorting game titles in the emulator’s UI. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:01:14 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#2783
No description provided.