From 383bed8098364158ba075a52dd3a6d3998185291 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Wed, 23 Jan 2013 15:28:11 -0400 Subject: [PATCH] Use const references for string function arguments --- src/modules/font/Font.h | 2 +- src/modules/font/freetype/Font.cpp | 2 +- src/modules/font/freetype/Font.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/font/Font.h b/src/modules/font/Font.h index 179805995..b3d76d2c5 100644 --- a/src/modules/font/Font.h +++ b/src/modules/font/Font.h @@ -40,7 +40,7 @@ class Font : public Module public: virtual Rasterizer *newRasterizer(Data *data, int size) = 0; - virtual Rasterizer *newRasterizer(love::image::ImageData *data, std::string glyphs) = 0; + virtual Rasterizer *newRasterizer(love::image::ImageData *data, const std::string &glyphs) = 0; virtual Rasterizer *newRasterizer(love::image::ImageData *data, unsigned int *glyphs, int length) = 0; virtual GlyphData *newGlyphData(Rasterizer *r, unsigned int glyph) = 0; diff --git a/src/modules/font/freetype/Font.cpp b/src/modules/font/freetype/Font.cpp index 00f3bdd85..f2bd63c38 100644 --- a/src/modules/font/freetype/Font.cpp +++ b/src/modules/font/freetype/Font.cpp @@ -48,7 +48,7 @@ Rasterizer *Font::newRasterizer(Data *data, int size) return new TrueTypeRasterizer(library, data, size); } -Rasterizer *Font::newRasterizer(love::image::ImageData *data, std::string text) +Rasterizer *Font::newRasterizer(love::image::ImageData *data, const std::string &text) { size_t strlen = text.size(); size_t numglyphs = 0; diff --git a/src/modules/font/freetype/Font.h b/src/modules/font/freetype/Font.h index 671954007..b8c8f6206 100644 --- a/src/modules/font/freetype/Font.h +++ b/src/modules/font/freetype/Font.h @@ -55,7 +55,7 @@ public: // Implements Font Rasterizer *newRasterizer(Data *data, int size); - Rasterizer *newRasterizer(love::image::ImageData *data, std::string text); + Rasterizer *newRasterizer(love::image::ImageData *data, const std::string &text); Rasterizer *newRasterizer(love::image::ImageData *data, unsigned int *glyphs, int numglyphs); GlyphData *newGlyphData(Rasterizer *r, unsigned int glyph);