~ubuntu-branches/debian/sid/mono-tools/sid

« back to all changes in this revision

Viewing changes to gendarme/rules/Gendarme.Rules.Performance/MathMinMaxCandidateRule.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2010-09-13 09:08:47 UTC
  • mfrom: (14.1.2 experimental)
  • Revision ID: james.westby@ubuntu.com-20100913090847-lhu3z021w2azaj8q
Tags: 2.6.2-3
Upload to Debian Unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
        // suggestion from https://bugzilla.novell.com/show_bug.cgi?id=373269
42
42
 
43
43
        /// <summary>
44
 
        /// This rule checks methods that seems to include code duplicating <c>Math.Min</c> or 
45
 
        /// <c>Math.Max</c> functionality. The JIT can inline those methods and provide better 
46
 
        /// performance compared to custom, inline, implementations.
 
44
        /// This rule checks methods for code which seems to duplicate <c>Math.Min</c> or 
 
45
        /// <c>Math.Max</c>. The JIT can inline these methods and generate
 
46
        /// better code for, at least some types, than it can for a custom inline
 
47
        /// implementation.
47
48
        /// </summary>
48
49
        /// <example>
49
50
        /// Bad example:
60
61
        /// <remarks>This rule is available since Gendarme 2.0</remarks>
61
62
 
62
63
        [Problem ("This method seems to include code duplicating Math.Min or Math.Max functionality.")]
63
 
        [Solution ("The JIT can inline the Math.Min and Math.Max methods which provides better performance compared to custom, inline, implementations.")]
 
64
        [Solution ("The JIT can (sometimes) generate better code for Math.Min and Math.Max methods than it can for hand-written versions.")]
64
65
        [EngineDependency (typeof (OpCodeEngine))]
65
66
        public class MathMinMaxCandidateRule : Rule, IMethodRule {
66
67