mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-09 14:55:08 -06:00
Return objects by reference instead of always cloning
This commit is contained in:
parent
1741301973
commit
c0789506e4
30 changed files with 158 additions and 54 deletions
|
@ -73,7 +73,21 @@ Point::distance_to(const Point* point) const
|
|||
}
|
||||
|
||||
SV*
|
||||
Point::to_SV_pureperl() {
|
||||
Point::to_SV_ref() const {
|
||||
SV* sv = newSV(0);
|
||||
sv_setref_pv( sv, "Slic3r::Point::Ref", (void*)this );
|
||||
return sv;
|
||||
}
|
||||
|
||||
SV*
|
||||
Point::to_SV_clone_ref() const {
|
||||
SV* sv = newSV(0);
|
||||
sv_setref_pv( sv, "Slic3r::Point", new Point(*this) );
|
||||
return sv;
|
||||
}
|
||||
|
||||
SV*
|
||||
Point::to_SV_pureperl() const {
|
||||
AV* av = newAV();
|
||||
av_fill(av, 1);
|
||||
av_store(av, 0, newSViv(this->x));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue