View Issue Details

IDProjectCategoryView StatusLast Update
0034424FPCRTLpublic2018-10-18 21:36
ReporterAlexey Tor.Assigned ToFlorian 
PrioritynormalSeverityminorReproducibilityN/A
Status resolvedResolutionfixed 
Product Version3.0.4Product Build 
Target VersionFixed in Version3.3.1 
Summary0034424: Types.pp needs more 'inline'
Descriptionfunction EqualRect(const r1,r2 : TRect) : Boolean;
function Rect(Left,Top,Right,Bottom : Integer) : TRect;
function Bounds(ALeft,ATop,AWidth,AHeight : Integer) : TRect;
function Point(x,y : Integer) : TPoint; inline;
function PtInRect(const Rect : TRect; const p : TPoint) : Boolean;
function IntersectRect(var Rect : TRect; const R1,R2 : TRect) : Boolean;
function UnionRect(var Rect : TRect; const R1,R2 : TRect) : Boolean;
function IsRectEmpty(const Rect : TRect) : Boolean;
function OffsetRect(var Rect : TRect;DX : Integer;DY : Integer) : Boolean;
function CenterPoint(const Rect: TRect): TPoint;
function InflateRect(var Rect: TRect; dx: Integer; dy: Integer): Boolean;
function Size(AWidth, AHeight: Integer): TSize;
function Size(const ARect: TRect): TSize;

here we see one "inline". Rect() is similar so set "inline" too. Size() is similar too. some others - maybe too.
TagsNo tags attached.
Fixed in Revision39984
FPCOldBugId
FPCTarget
Attached Files

Activities

Serge Anvarov

2018-10-17 21:27

reporter   ~0111442

Only this function is short:
function Rect(Left,Top,Right,Bottom : Integer) : TRect;
function Bounds(ALeft,ATop,AWidth,AHeight : Integer) : TRect;
function Size(AWidth, AHeight: Integer): TSize;
Their prepare code is comparable in size with inlined code.

Point already inline.

For other, in my opinion, not a good idea. The size of the code will grow significantly, but the speed a little bit, and these functions are used for GUI applications, where it is unlikely to be noticeable.

Florian

2018-10-18 21:36

administrator   ~0111462

Added those suggested by Serge, more do not make sense.

Issue History

Date Modified Username Field Change
2018-10-16 09:21 Alexey Tor. New Issue
2018-10-17 21:27 Serge Anvarov Note Added: 0111442
2018-10-18 21:36 Florian Fixed in Revision => 39984
2018-10-18 21:36 Florian Note Added: 0111462
2018-10-18 21:36 Florian Status new => resolved
2018-10-18 21:36 Florian Fixed in Version => 3.3.1
2018-10-18 21:36 Florian Resolution open => fixed
2018-10-18 21:36 Florian Assigned To => Florian