mirror of
				https://github.com/moby/moby.git
				synced 2022-11-09 12:21:53 -05:00 
			
		
		
		
	Fix RefCounter count return
Signed-off-by: Alfred Landrum <alfred.landrum@docker.com>
This commit is contained in:
		
							parent
							
								
									c3b660b112
								
							
						
					
					
						commit
						874a502b1d
					
				
					 1 changed files with 4 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -40,8 +40,9 @@ func (c *RefCounter) Increment(path string) int {
 | 
			
		|||
		}
 | 
			
		||||
	}
 | 
			
		||||
	m.count++
 | 
			
		||||
	count := m.count
 | 
			
		||||
	c.mu.Unlock()
 | 
			
		||||
	return m.count
 | 
			
		||||
	return count
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Decrement decreases the ref count for the given id and returns the current count
 | 
			
		||||
| 
						 | 
				
			
			@ -62,6 +63,7 @@ func (c *RefCounter) Decrement(path string) int {
 | 
			
		|||
		}
 | 
			
		||||
	}
 | 
			
		||||
	m.count--
 | 
			
		||||
	count := m.count
 | 
			
		||||
	c.mu.Unlock()
 | 
			
		||||
	return m.count
 | 
			
		||||
	return count
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue