Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

dirstate.cpp: use const dirstate& as param type instead of pointer

No reason to use a pointer, since we never pass 0 anyway.
Change parameter name from pd to ds.

Changeset cf7e32fb7f2b

Parent 4f1e90e1f4e8

by Adrian Buehlmann

Changes to one file · Browse files at cf7e32fb7f2b Showing diff from parent 4f1e90e1f4e8 Diff from another changeset...

 
258
259
260
261
 
262
263
264
 
270
271
272
273
274
 
 
275
276
277
 
312
313
314
315
 
316
317
318
 
319
320
321
 
358
359
360
361
362
 
 
363
364
365
366
367
368
 
369
370
371
 
377
378
379
380
 
381
382
 
383
384
385
 
258
259
260
 
261
262
263
264
 
270
271
272
 
 
273
274
275
276
277
 
312
313
314
 
315
316
317
 
318
319
320
321
 
358
359
360
 
 
361
362
363
364
365
366
367
 
368
369
370
371
 
377
378
379
 
380
381
 
382
383
384
385
@@ -258,7 +258,7 @@
     static int HgQueryDirstateDirectory( - const std::string& hgroot, const dirstate* pd, + const std::string& hgroot, const dirstate& ds,   const std::string& relpath, char& outStatus)  {   bool added = false; @@ -270,8 +270,8 @@
    struct _stat stat;   - for (dirstate::Iter iter = pd->begin(); - iter != pd->end() && !modified; ++iter) + for (dirstate::Iter iter = ds.begin(); + iter != ds.end() && !modified; ++iter)   {   const direntry& e = *iter;   @@ -312,10 +312,10 @@
     static int HgQueryDirstateFile( - const dirstate* pd, const std::string& relpath, + const dirstate& ds, const std::string& relpath,   const struct _stat& stat, char& outStatus)  { - for (dirstate::Iter iter = pd->begin(); iter != pd->end(); ++iter) + for (dirstate::Iter iter = ds.begin(); iter != ds.end(); ++iter)   {   const direntry& e = *iter;   @@ -358,14 +358,14 @@
  if (relpath.compare(0, 3, ".hg") == 0)   return 0; // don't descend into .hg dir   - const dirstate* pd = dirstatecache::get(hgroot); - if (!pd) + const dirstate* pds = dirstatecache::get(hgroot); + if (!pds)   {   TDEBUG_TRACE("HgQueryDirstate: dirstatecache::get(" << hgroot << ") returns 0");   return 0;   }   - if (filterStatus == 'A' && pd->num_added() == 0) + if (filterStatus == 'A' && pds->num_added() == 0)   return 0;     for (size_t i = 0; i < relpath.size(); ++i) @@ -377,9 +377,9 @@
  int res = 0;     if (PathIsDirectory(path.c_str())) - res = HgQueryDirstateDirectory(hgroot, pd, relpath, outStatus); + res = HgQueryDirstateDirectory(hgroot, *pds, relpath, outStatus);   else - res = HgQueryDirstateFile(pd, relpath, stat, outStatus); + res = HgQueryDirstateFile(*pds, relpath, stat, outStatus);     return res;  }