Skip to content

Commit fe37d44

Browse files
committed
Merge pull request #1391 from mgreter/code-improvements
Fix a few obvious code issues
2 parents 92be77a + 50bcd62 commit fe37d44

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

include/sass2scss.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ namespace Sass
8080
};
8181

8282
// function only available in c++ code
83-
char* sass2scss (const string sass, const int options);
83+
char* sass2scss (const string& sass, const int options);
8484

8585
}
8686
// EO namespace

src/ast.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace Sass {
3232
bool Compound_Selector::operator< (const Compound_Selector& rhs) const
3333
{
3434
size_t L = std::min(length(), rhs.length());
35-
for (size_t i = 0; i < L && i < L; ++i)
35+
for (size_t i = 0; i < L; ++i)
3636
{
3737
Simple_Selector* l = (*this)[i];
3838
Simple_Selector* r = rhs[i];
@@ -568,7 +568,7 @@ namespace Sass {
568568
//for (auto l : lset) { cerr << "l: " << l << endl; }
569569
//for (auto r : rset) { cerr << "r: " << r << endl; }
570570

571-
if (lset.size() == 0) return true;
571+
if (lset.empty()) return true;
572572
// return true if rset contains all the elements of lset
573573
return includes(rset.begin(), rset.end(), lset.begin(), lset.end());
574574

src/color_maps.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ namespace Sass {
613613
return 0;
614614
}
615615

616-
const Color* name_to_color(const std::string key)
616+
const Color* name_to_color(const std::string& key)
617617
{
618618
return name_to_color(key.c_str());
619619
}

src/color_maps.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ namespace Sass {
323323
extern const std::map<const char*, const Color*, map_cmp_str> names_to_colors;
324324

325325
extern const Color* name_to_color(const char*);
326-
extern const Color* name_to_color(const std::string);
326+
extern const Color* name_to_color(const std::string&);
327327
extern const char* color_to_name(const int);
328328
extern const char* color_to_name(const Color&);
329329
extern const char* color_to_name(const double);

src/sass2scss.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ namespace Sass
777777
}
778778

779779
// the main converter function for c++
780-
char* sass2scss (const string sass, const int options)
780+
char* sass2scss (const string& sass, const int options)
781781
{
782782

783783
// local variables

0 commit comments

Comments
 (0)