mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 11:42:30 +00:00 
			
		
		
		
	hashlib mfp<> performance improvements
This commit is contained in:
		
							parent
							
								
									13e15a24a2
								
							
						
					
					
						commit
						ea492abcf0
					
				
					 1 changed files with 7 additions and 2 deletions
				
			
		|  | @ -1015,7 +1015,10 @@ public: | ||||||
| 
 | 
 | ||||||
| 	const K &find(const K &a) const | 	const K &find(const K &a) const | ||||||
| 	{ | 	{ | ||||||
| 		return (*this)[ifind((*this)(a))]; | 		int i = database.at(a, -1); | ||||||
|  | 		if (i < 0) | ||||||
|  | 			return a; | ||||||
|  | 		return (*this)[ifind(i)]; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	void merge(const K &a, const K &b) | 	void merge(const K &a, const K &b) | ||||||
|  | @ -1025,7 +1028,9 @@ public: | ||||||
| 
 | 
 | ||||||
| 	void promote(const K &a) | 	void promote(const K &a) | ||||||
| 	{ | 	{ | ||||||
| 		ipromote((*this)(a)); | 		int i = database.at(a, -1); | ||||||
|  | 		if (i >= 0) | ||||||
|  | 			ipromote(i); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	void swap(mfp &other) | 	void swap(mfp &other) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue