Remove YAGNI methods from performance systems
GridChunk: Remove getWorldBounds, markAllDirty, getVisibleChunks - getWorldBounds: Chunk visibility handled by isVisible() instead - markAllDirty: GridLayers uses per-cell markDirty() pattern - getVisibleChunks: GridLayers computes visible range inline - Keep dirtyChunks() for diagnostics GridLayers: Remove getChunkCoords - Trivial helper replaced by inline division throughout codebase SpatialHash: Remove queryRect, totalEntities, cleanBucket - queryRect: Exceeds #115 scope (only queryRadius required) - totalEntities: Redundant with separate entity count tracking - cleanBucket: Dead code - expired weak_ptrs cleaned during remove/update All removals identified via cppcheck static analysis. Core functionality of each system remains intact and actively used. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
ae27e7deee
commit
b6eb70748a
6 changed files with 0 additions and 123 deletions
|
|
@ -37,15 +37,11 @@ public:
|
|||
// Returns entities whose positions are within the circular radius
|
||||
std::vector<std::shared_ptr<UIEntity>> queryRadius(float x, float y, float radius) const;
|
||||
|
||||
// Query all entities within a rectangular region
|
||||
std::vector<std::shared_ptr<UIEntity>> queryRect(float x, float y, float width, float height) const;
|
||||
|
||||
// Clear all entities from the hash
|
||||
void clear();
|
||||
|
||||
// Get statistics for debugging
|
||||
size_t bucketCount() const { return buckets.size(); }
|
||||
size_t totalEntities() const;
|
||||
|
||||
private:
|
||||
int bucket_size;
|
||||
|
|
@ -72,10 +68,4 @@ private:
|
|||
|
||||
// Get all bucket coordinates that overlap with a radius query
|
||||
std::vector<std::pair<int, int>> getBucketsInRadius(float x, float y, float radius) const;
|
||||
|
||||
// Get all bucket coordinates that overlap with a rectangle
|
||||
std::vector<std::pair<int, int>> getBucketsInRect(float x, float y, float width, float height) const;
|
||||
|
||||
// Clean expired weak_ptrs from a bucket
|
||||
void cleanBucket(std::vector<std::weak_ptr<UIEntity>>& bucket);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue