refactor: eliminar ShapeLoader::resolvePath i BASE_PATH (codi mort)

Cap caller invocava resolvePath fora de la seua pròpia definició.
A més, BASE_PATH apuntava a "data/shapes/" mentre que load() ja
construeix el path amb el prefix "shapes/" directament — el helper
mai s'hauria activat encara que es cridara.

Hallazgo #18 de CODE_REVIEW.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-20 16:37:07 +02:00
parent 9e54dde490
commit 682c27c07c
2 changed files with 56 additions and 75 deletions
+5 -9
View File
@@ -11,9 +11,9 @@
namespace Graphics {
// Carregador estàtic de formes con caché
class ShapeLoader {
public:
// Carregador estàtic de formes con caché
class ShapeLoader {
public:
// No instanciable (tot estàtic)
ShapeLoader() = delete;
@@ -28,12 +28,8 @@ class ShapeLoader {
// Estadístiques (debug)
static auto getCacheSize() -> size_t;
private:
private:
static std::unordered_map<std::string, std::shared_ptr<Shape>> cache;
static constexpr const char* BASE_PATH = "data/shapes/";
// Helpers privats
static auto resolvePath(const std::string& filename) -> std::string;
};
};
} // namespace Graphics