mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 03:32:29 +00:00 
			
		
		
		
	Merge pull request #1414 from hzeller/improve-replace-with-empty-map
Avoid work in replace() if rules empty.
This commit is contained in:
		
						commit
						d5f0794a53
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		|  | @ -3083,6 +3083,7 @@ void RTLIL::SigSpec::replace(const dict<RTLIL::SigBit, RTLIL::SigBit> &rules, RT | |||
| 	log_assert(other != NULL); | ||||
| 	log_assert(width_ == other->width_); | ||||
| 
 | ||||
| 	if (rules.empty()) return; | ||||
| 	unpack(); | ||||
| 	other->unpack(); | ||||
| 
 | ||||
|  | @ -3107,6 +3108,7 @@ void RTLIL::SigSpec::replace(const std::map<RTLIL::SigBit, RTLIL::SigBit> &rules | |||
| 	log_assert(other != NULL); | ||||
| 	log_assert(width_ == other->width_); | ||||
| 
 | ||||
| 	if (rules.empty()) return; | ||||
| 	unpack(); | ||||
| 	other->unpack(); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue