Skip to content

Files

Latest commit

 

History

History
11 lines (6 loc) · 694 Bytes

File metadata and controls

11 lines (6 loc) · 694 Bytes

Pattern: Missing use of static member

Issue: -

Description

Members that do not access instance data or call instance methods can be marked as static. After you mark the methods as static, the compiler will emit nonvirtual call sites to these members. Emitting nonvirtual call sites will prevent a check at run time for each call that makes sure that the current object pointer is non-null. This can achieve a measurable performance gain for performance-sensitive code. In some cases, the failure to access the current object instance represents a correctness issue.

Further Reading