OSDN Git Service

Small cleanup - use countof() macro to calculate array size.
authorKimmo Varis <kimmov@gmail.com>
Tue, 21 Oct 2008 19:11:35 +0000 (19:11 +0000)
committerKimmo Varis <kimmov@gmail.com>
Tue, 21 Oct 2008 19:11:35 +0000 (19:11 +0000)
Src/DirViewColItems.cpp

index f067341..73510d5 100644 (file)
@@ -887,7 +887,7 @@ CDirView::GetColDefaultOrder(int col) const
 const DirColInfo *
 CDirView::DirViewColItems_GetDirColInfo(int col) const
 {
-       if (col < 0 || col >= sizeof(f_cols)/sizeof(f_cols[0]))
+       if (col < 0 || col >= countof(f_cols))
        {
                ASSERT(0); // fix caller, should not ask for nonexistent columns
                return 0;
@@ -901,7 +901,7 @@ CDirView::DirViewColItems_GetDirColInfo(int col) const
 static bool
 IsColById(int col, int id)
 {
-       if (col < 0 || col >= sizeof(f_cols)/sizeof(f_cols[0]))
+       if (col < 0 || col >= countof(f_cols))
        {
                ASSERT(0); // fix caller, should not ask for nonexistent columns
                return false;