| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #ifndef _FPDFSDK_MGR_H | 7 #ifndef _FPDFSDK_MGR_H |
| 8 #define _FPDFSDK_MGR_H | 8 #define _FPDFSDK_MGR_H |
| 9 | 9 |
| 10 #include "fsdk_common.h" | 10 #include "fsdk_common.h" |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 | 557 |
| 558 int iGreate = (*pCompare)(Value1, Value2); | 558 int iGreate = (*pCompare)(Value1, Value2); |
| 559 if ((bAscend && iGreate > 0) || (!bAscend && iGreate < 0
)) | 559 if ((bAscend && iGreate > 0) || (!bAscend && iGreate < 0
)) |
| 560 { | 560 { |
| 561 this->SetAt(nStartPos, Value2); | 561 this->SetAt(nStartPos, Value2); |
| 562 this->SetAt(nStopPos, Value1); | 562 this->SetAt(nStopPos, Value1); |
| 563 } | 563 } |
| 564 return; | 564 return; |
| 565 } | 565 } |
| 566 | 566 |
| 567 » » FX_UINT m = (nStartPos + nStopPos) / 2; | 567 » » FX_UINT m = nStartPos + (nStopPos - nStartPos) / 2; |
| 568 FX_UINT i = nStartPos; | 568 FX_UINT i = nStartPos; |
| 569 | 569 |
| 570 TYPE Value = this->GetAt(m); | 570 TYPE Value = this->GetAt(m); |
| 571 | 571 |
| 572 while (i < m) | 572 while (i < m) |
| 573 { | 573 { |
| 574 TYPE temp = this->GetAt(i); | 574 TYPE temp = this->GetAt(i); |
| 575 | 575 |
| 576 int iGreate = (*pCompare)(temp, Value); | 576 int iGreate = (*pCompare)(temp, Value); |
| 577 if ((bAscend && iGreate > 0) || (!bAscend && iGreate < 0
)) | 577 if ((bAscend && iGreate > 0) || (!bAscend && iGreate < 0
)) |
| (...skipping 28 matching lines...) Expand all Loading... |
| 606 } | 606 } |
| 607 | 607 |
| 608 if (nStartPos < m) QuickSort(nStartPos, m, bAscend, pCompare); | 608 if (nStartPos < m) QuickSort(nStartPos, m, bAscend, pCompare); |
| 609 if (nStopPos > m) QuickSort(m, nStopPos, bAscend, pCompare); | 609 if (nStopPos > m) QuickSort(m, nStopPos, bAscend, pCompare); |
| 610 } | 610 } |
| 611 }; | 611 }; |
| 612 | 612 |
| 613 | 613 |
| 614 #endif //_FPDFSDK_MGR_H | 614 #endif //_FPDFSDK_MGR_H |
| 615 | 615 |
| OLD | NEW |