mirror of
				https://github.com/Zygo/bees.git
				synced 2025-11-04 04:00:36 +01:00 
			
		
		
		
	bytevector: don't need _all_ of those mutexes
Methods that don't even look at the pointer don't need a mutex. Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
		@@ -26,14 +26,12 @@ namespace crucible {
 | 
				
			|||||||
	size_t
 | 
						size_t
 | 
				
			||||||
	ByteVector::size() const
 | 
						ByteVector::size() const
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		unique_lock<mutex> lock(m_mutex);
 | 
					 | 
				
			||||||
		return m_size;
 | 
							return m_size;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	bool
 | 
						bool
 | 
				
			||||||
	ByteVector::empty() const
 | 
						ByteVector::empty() const
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		unique_lock<mutex> lock(m_mutex);
 | 
					 | 
				
			||||||
		return !m_ptr || !m_size;
 | 
							return !m_ptr || !m_size;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user