View Issue Details

IDProjectCategoryView StatusLast Update
0016965Open CASCADEOCCT:Application Frameworkpublic2012-01-12 11:30
ReporteragvAssigned Toagv 
PrioritynormalSeverityfeature 
Status closedResolutionfixed 
OSAll 
Fixed in Version6.2.1 
Summary0016965: OCAF attributes should return strings by reference rather than by value
DescriptionThe improvement is simple: changing the signatures of a number of methods in
TDataStd and TDataExt that return TCollection_AsciiString and
TCollection_ExtendedString. When a method just copies the internal string to its
return value, it is better to return a reference. For example:

--> Previous version:
TCollection_ExtendedString TDataStd_Name::Get() const {return myString;}
--> New version:
const TCollection_ExtendedString& TDataStd_Name::Get() const {return myString;}

The benefit: the returned value is passed through a chain of nested calls, then
the gain in CPU time may become important.
Additional information
and documentation updates
Documentation remark, added by AGV 2007-09-21 08:39:12:

Improvements:
Changing the signatures of a number of methods in TDataStd that return
TCollection_AsciiString and TCollection_ExtendedString. Instead of copying the
internal string to return value, it is better to return a reference. For example:

--> Previous version:
TCollection_ExtendedString TDataStd_Name::Get() const {return myString;}
--> New version:
const TCollection_ExtendedString& TDataStd_Name::Get() const {return myString;}

The benefit: the returned value is passed through a chain of nested calls, then
the gain in CPU time may become important.
Modified entities:
Package: TDataStd
TagsNo tags attached.
Test case number

Attached Files

  • occ16965.tar.gz (9,754 bytes)
  • occ16965-v2.tar.gz (9,350 bytes)
  • OCC16965-mkv.tar.gz (10,149 bytes)

Relationships

related to 0016782 closedszy New OCAF attributes 

Activities

2007-09-14 15:28

 

occ16965.tar.gz (9,754 bytes)

2007-09-21 08:35

 

occ16965-v2.tar.gz (9,350 bytes)

2007-09-24 14:57

 

OCC16965-mkv.tar.gz (10,149 bytes)

Issue History

Date Modified Username Field Change
2007-09-14 17:30 agv OtherBugsDependingOnThis => 16782
2007-09-21 09:42 bugmaster Assigned To bugmaster => agv
2007-09-21 09:42 bugmaster Status new => assigned
2007-09-21 10:39 agv Status assigned => resolved
2007-09-25 17:03 bugmaster Status resolved => tested
2007-10-25 18:32 bugmaster Status tested => verified
2009-06-23 19:09 bugmaster Status verified => closed
2009-06-23 19:09 bugmaster Resolution @0@ => fixed
2011-08-02 10:32 bugmaster Category OCCT:OCAF => OCCT:Application Framework
2012-01-12 11:30 atp Description Updated
2012-01-12 11:30 atp Additional Information Updated