Menu

#181 Refactoring of code in /src/proc-db/surfaceintersect.cpp

Untested
open
None
5
2013-05-28
2013-05-19
jasleen
No

This patch removes the duplicacy of code in /src/proc-db/surfaceintersect.cpp

1 Attachments

Discussion

  • Daniel Roßberg

    Daniel Roßberg - 2013-05-19

    Correct me if I' wrong but Curve_Compare_start() and Curve_Compare_end() always return 0.

     
  • jasleen

    jasleen - 2013-05-20

    Oops.. Yes, you're right, I just made the change and uploaded a new patch.

     
  • Daniel Roßberg

    Daniel Roßberg - 2013-05-20

    OK, now looking at the functions I asked myself (and now I'm asking you): What's the difference between Curve_Compare_start() and Curve_Compare_end()?

     
  • jasleen

    jasleen - 2013-05-23

    They are doing same, but I didn't change that because they are calling by different names.

     
  • Daniel Roßberg

    Daniel Roßberg - 2013-05-24

    So they are a perfect example for the duplicacy of code. Besides Curve_Compare_end() is unused, there are no references to this function.

    BTW, why contains Curve_compare() only a part of the duplicated code? You could have put the whole functionality into this function.

     
  • jasleen

    jasleen - 2013-05-25

    Curve_Compare_start() and Curve_Compare_end() are calling two different functions PointAtStart() and PointAtEnd().
    That's why I put part of duplicate code in Curve_compare()

     

    Last edit: jasleen 2013-05-25
  • Daniel Roßberg

    Daniel Roßberg - 2013-05-28

    That's true, so Curve_Compare_start() and Curve_Compare_end() aren't identical. Remaining the questions:
    - Is Curve_Compare_end() used somewhere or can you remove it?
    - Why not "return Curve_compare(A, B);"? (The comment "we should have already done this... but just in case" is wrong. There is no return before.)

     

Log in to post a comment.