Skip to content

Commit

Permalink
Minor cleanup (#422)
Browse files Browse the repository at this point in the history
  • Loading branch information
reunanen authored Feb 26, 2023
1 parent fecaa16 commit e9bd409
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions CPP/Clipper2Lib/include/clipper2/clipper.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,7 @@ namespace Clipper2Lib {
{
if (rect.IsEmpty() || path.empty()) return Paths64();
class RectClip rc(rect);
Paths64 tmp;
tmp.push_back(path);
return rc.Execute(tmp, convex_only);
return rc.Execute(Paths64{ path }, convex_only);
}

inline PathsD RectClip(const RectD& rect,
Expand All @@ -231,9 +229,7 @@ namespace Clipper2Lib {
inline PathsD RectClip(const RectD& rect,
const PathD& path, bool convex_only = false, int precision = 2)
{
PathsD tmp;
tmp.push_back(path);
return RectClip(rect, tmp, convex_only, precision);
return RectClip(rect, PathsD{ path }, convex_only, precision);
}

inline Paths64 RectClipLines(const Rect64& rect, const Paths64& lines)
Expand All @@ -245,16 +241,12 @@ namespace Clipper2Lib {

inline Paths64 RectClipLines(const Rect64& rect, const Path64& line)
{
Paths64 tmp;
tmp.push_back(line);
return RectClipLines(rect, tmp);
return RectClipLines(rect, Paths64{ line });
}

inline PathsD RectClipLines(const RectD& rect, const PathD& line, int precision = 2)
{
PathsD tmp;
tmp.push_back(line);
return RectClip(rect, tmp, precision);
return RectClip(rect, PathsD{ line }, precision);
}

inline PathsD RectClipLines(const RectD& rect, const PathsD& lines, int precision = 2)
Expand Down

0 comments on commit e9bd409

Please sign in to comment.