Ignore:
Timestamp:
08/24/15 14:53:33 (6 years ago)
Author:
mhnguyen
Message:

Clearing some redundant codes and add some comments

Test
No

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/node/axis.cpp

    r666 r667  
    251251    int nbServer = client->serverSize; 
    252252    int range, clientSize = client->clientSize; 
     253 
    253254    size_t ni = this->n.getValue(); 
    254255    size_t ibegin = this->begin.getValue(); 
     256    size_t zoom_end = global_zoom_begin+global_zoom_size-1; 
     257    size_t nZoomCount = 0; 
     258    for (size_t idx = 0; idx < ni; ++idx) 
     259    { 
     260      size_t globalIndex = ibegin + idx; 
     261 
     262      if (globalIndex >= global_zoom_begin && globalIndex <= zoom_end) ++nZoomCount; 
     263    } 
    255264 
    256265    CArray<size_t,1> globalIndexAxis(ni); 
    257     int zoom_end = global_zoom_begin+global_zoom_size-1; 
    258     std::vector<size_t> globalAxisZoom; 
     266    std::vector<size_t> globalAxisZoom(nZoomCount); 
     267    nZoomCount = 0; 
    259268    for (size_t idx = 0; idx < ni; ++idx) 
    260269    { 
    261270      size_t globalIndex = ibegin + idx; 
    262271      globalIndexAxis(idx) = globalIndex; 
    263       if (globalIndex >= global_zoom_begin && globalIndex <= zoom_end) globalAxisZoom.push_back(globalIndex); 
     272      if (globalIndex >= global_zoom_begin && globalIndex <= zoom_end) 
     273      { 
     274        globalAxisZoom[nZoomCount]; 
     275        ++nZoomCount; 
     276      } 
    264277    } 
    265278 
Note: See TracChangeset for help on using the changeset viewer.