Skip to content

Commit

Permalink
removed redundant types from return
Browse files Browse the repository at this point in the history
  • Loading branch information
mgieseki committed Jan 7, 2025
1 parent 818191f commit b97fcf3
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/CMapReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ unique_ptr<CMap> CMapReader::read (const string &fname) {
return read(ifs, fname);
}
_tokens.clear();
return unique_ptr<CMap>();
return {};
}


Expand Down
2 changes: 1 addition & 1 deletion src/EllipticalArc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ static CubicBezier approx_unit_arc (double phi, double delta) {
DPair p4(cos(phi+delta), sin(phi+delta));
DPair p2(p1.x()-c*p1.y(), p1.y()+c*p1.x());
DPair p3(p4.x()+c*p4.y(), p4.y()-c*p4.x());
return CubicBezier(p1, p2, p3, p4);
return {p1, p2, p3, p4};
}


Expand Down
2 changes: 1 addition & 1 deletion src/Font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ int PhysicalFont::collectCharMapIDs (std::vector<CharMapID> &charMapIDs) const {
Character PhysicalFont::decodeChar (uint32_t c) const {
if (const FontEncoding *enc = encoding())
return enc->decode(c);
return Character(Character::CHRCODE, c);
return {Character::CHRCODE, c};
}


Expand Down
2 changes: 1 addition & 1 deletion src/FontEncoding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Character FontEncodingPair::decode (uint32_t c) const {
chr = _enc2->decode(chr.number());
return chr;
}
return Character(Character::INDEX, 0);
return {Character::INDEX, 0};
}


Expand Down
8 changes: 4 additions & 4 deletions src/FontEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,15 +372,15 @@ int FontEngine::getCharMapIDs (vector<CharMapID> &charmapIDs) const {

CharMapID FontEngine::setUnicodeCharMap () {
if (_currentFace && FT_Select_Charmap(_currentFace, FT_ENCODING_UNICODE) == 0)
return CharMapID(uint8_t(_currentFace->charmap->platform_id), uint8_t(_currentFace->charmap->encoding_id));
return CharMapID();
return {uint8_t(_currentFace->charmap->platform_id), uint8_t(_currentFace->charmap->encoding_id)};
return {};
}


CharMapID FontEngine::setCustomCharMap () {
if (_currentFace && FT_Select_Charmap(_currentFace, FT_ENCODING_ADOBE_CUSTOM) == 0)
return CharMapID(uint8_t(_currentFace->charmap->platform_id), uint8_t(_currentFace->charmap->encoding_id));
return CharMapID();
return {uint8_t(_currentFace->charmap->platform_id), uint8_t(_currentFace->charmap->encoding_id)};
return {};
}


Expand Down
2 changes: 1 addition & 1 deletion src/MiKTeXCom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ string MiKTeXCom::getBinDir () {
_session->GetMiKTeXSetupInfo(&info);
#endif
_bstr_t bindir = info.binDirectory;
return string(bindir);
return {bindir};
}


Expand Down
2 changes: 1 addition & 1 deletion src/ttf/TTFTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ TableBuffer TTFTable::createBuffer () const {
write(vecstream);
vector<char> vec;
vecstream.swap_vector(vec); // move data from vector stream to vec
return TableBuffer(tag(), std::move(vec));
return {tag(), std::move(vec)};
}


Expand Down

0 comments on commit b97fcf3

Please sign in to comment.