Bamboo.Prevalence.Collections.List.Map C# (CSharp) Method

Map() public method

Maps every object in this list to an equivalent (Equals(item) returns true) in the list passed as argument. The entire mapping operation is accomplished in the context of a writer lock.
public Map ( IEnumerable list ) : void
list IEnumerable
return void
		public void Map(IEnumerable list)
		{
			if (null == list)
			{
				throw new ArgumentNullException("list");
			}

			AcquireWriterLock();
			try
			{
				for (int i=0; i<_list.Count; ++i)
				{
					object existing = _list[i];
					if (null != existing)
					{
						foreach (object item in list)
						{
							if (existing.Equals(item))
							{
								_list[i] = item;
								break;
							}
						}
					}
				}
			}
			finally
			{
				ReleaseWriterLock();
			}
		}

Same methods

List::Map ( Mapping mapping ) : void