From 41b720e44c2f301093afb3ba0cb50bef97035c25 Mon Sep 17 00:00:00 2001 From: Aaron Gokaslan Date: Tue, 17 Nov 2020 09:19:35 -0800 Subject: [PATCH] Apply clang-tidy performance fixes --- src/python/corrade/containers.cpp | 2 +- src/python/magnum/gl.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/python/corrade/containers.cpp b/src/python/corrade/containers.cpp index 73bce47..b4b4820 100644 --- a/src/python/corrade/containers.cpp +++ b/src/python/corrade/containers.cpp @@ -51,7 +51,7 @@ struct Slice { std::ptrdiff_t step; }; -Slice calculateSlice(py::slice slice, std::size_t containerSize) { +Slice calculateSlice(const py::slice& slice, std::size_t containerSize) { std::size_t size; std::ptrdiff_t start, stop, step; diff --git a/src/python/magnum/gl.cpp b/src/python/magnum/gl.cpp index 4f6ceb1..ce81074 100644 --- a/src/python/magnum/gl.cpp +++ b/src/python/magnum/gl.cpp @@ -110,7 +110,7 @@ template void texture(py::class_ .def_property("max_level", nullptr, &GL::Texture::setMaxLevel, "Max mip level") #endif .def_property("minification_filter", nullptr, - [](GL::Texture& self, py::object value) { + [](GL::Texture& self, const py::object& value) { if(py::isinstance(value)) self.setMinificationFilter(py::cast(value)); else if(py::isinstance(value)) @@ -145,7 +145,7 @@ template void texture(py::class_ } }, "Minification filter") .def_property("magnification_filter", nullptr, - [](GL::Texture& self, py::object filter) { + [](GL::Texture& self, const py::object& filter) { if(py::isinstance(filter)) self.setMagnificationFilter(py::cast(filter)); else if(py::isinstance(filter)) @@ -163,7 +163,7 @@ template void texture(py::class_ .def_property("lod_bias", nullptr, &GL::Texture::setLodBias, "Level-of-detail bias") #endif .def_property("wrapping", nullptr, - [](GL::Texture& self, py::object wrapping) { + [](GL::Texture& self, const py::object& wrapping) { /** @todo accept two/three different values as well */ if(py::isinstance(wrapping)) self.setWrapping(py::cast(wrapping)); @@ -179,7 +179,7 @@ template void texture(py::class_ #ifdef MAGNUM_TARGET_GLES2 &GL::Texture::setBorderColor, #else - [](GL::Texture& self, py::object color) { + [](GL::Texture& self, const py::object& color) { if(py::isinstance(color)) self.setBorderColor(py::cast(color)); else if(py::isinstance(color))