Advertisement
Guest User

отрефактори код

a guest
Nov 28th, 2014
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. bool function(double dist0, double dist1, double dist2, double tolerance)
  2. {
  3.     const double minDist = mathlib::min(dist0, dist1, dist2);
  4.     if (minDist > tolerance)
  5.         return false;
  6.  
  7.     if (dist0 <= tolerance)
  8.     {
  9.         idx1 = trg0;
  10.         idx2 = trg1;
  11.         return true;
  12.     }
  13.  
  14.     if (dist1 <= tolerance)
  15.     {
  16.         idx1 = trg0;
  17.         idx2 = trg2;
  18.         return true;
  19.     }
  20.  
  21.     if (dist2 <= tolerance)
  22.     {
  23.         idx1 = trg1;
  24.         idx2 = trg2;
  25.         return true;
  26.     }
  27.  
  28.     return false;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement