Re: Map Needs Merge

new topic     » goto parent     » topic index » view thread      » older message » newer message
euphoric said...

Anybody want to try their hand at a fast and efficient map:merge() function?

map:merge( map_one, map_two ) -- merge map_two into map_one (?) 

or something like that.

This needs to be in std/map.e. smile

Is this what you want?

map:copy( map_one, map_two ) 
delete( map_two ) 

From the docs... (emphasis mine)

docs said...

Returns:
If dest_map was not provided, an exact duplicate of source_map otherwise dest_map, which does not have to be empty, is returned with the new values copied from source_map, according to the put_operation value.

-Greg

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu