Преглед изворни кода

kernel/thread: Make GetFreeThreadLocalSlot() reference parameter a const reference

This function only reads the data being referenced, it doesn't modify
it, so we can turn the reference into a const reference.
Lioncash пре 8 година
родитељ
комит
fac0e42b2f
1 измењених фајлова са 2 додато и 1 уклоњено
  1. 2 1
      src/core/hle/kernel/thread.cpp

+ 2 - 1
src/core/hle/kernel/thread.cpp

@@ -252,7 +252,8 @@ void Thread::ResumeFromWait() {
  * slot: The index of the first free slot in the indicated page.
  * alloc_needed: Whether there's a need to allocate a new TLS page (All pages are full).
  */
-static std::tuple<u32, u32, bool> GetFreeThreadLocalSlot(std::vector<std::bitset<8>>& tls_slots) {
+static std::tuple<u32, u32, bool> GetFreeThreadLocalSlot(
+    const std::vector<std::bitset<8>>& tls_slots) {
     // Iterate over all the allocated pages, and try to find one where not all slots are used.
     for (unsigned page = 0; page < tls_slots.size(); ++page) {
         const auto& page_tls_slots = tls_slots[page];