Commits

Alex Szpakowski committed 7c7a7a4

Use const references for string function arguments

  • Participants
  • Parent commits 7c527bb

Comments (0)

Files changed (3)

File src/modules/font/Font.h

 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;
 

File src/modules/font/freetype/Font.cpp

 	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;

File src/modules/font/freetype/Font.h

 
 	// 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);