Merge pull request #3687 from lioncash/constness

surface_base: Make IsInside() a const member function
This commit is contained in:
Rodrigo Locatti 2020-04-16 01:22:50 -03:00 committed by GitHub
commit 60e8de7c95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -72,9 +72,9 @@ public:
return (cpu_addr < end) && (cpu_addr_end > start); return (cpu_addr < end) && (cpu_addr_end > start);
} }
bool IsInside(const GPUVAddr other_start, const GPUVAddr other_end) { bool IsInside(const GPUVAddr other_start, const GPUVAddr other_end) const {
const GPUVAddr gpu_addr_end = gpu_addr + guest_memory_size; const GPUVAddr gpu_addr_end = gpu_addr + guest_memory_size;
return (gpu_addr <= other_start && other_end <= gpu_addr_end); return gpu_addr <= other_start && other_end <= gpu_addr_end;
} }
// Use only when recycling a surface // Use only when recycling a surface