void CFolderCrawler::AddDirectoryForUpdate(const CTGitPath& path)
{
	/* Index file changing*/
	if( GitStatus::IsExistIndexLockFile((CString&)path.GetWinPathString()))
		return;

	if (!CGitStatusCache::Instance().IsPathGood(path))
		return;
	{
		ATLTRACE(_T("AddDirectoryForUpdate %s\n"),path.GetWinPath());

		AutoLocker lock(m_critSec);

		RemoveDuplicate(m_foldersToUpdate, path);

		m_foldersToUpdate.push_back(path);
		m_foldersToUpdate.back().SetCustomData(GetTickCount()+10);

		//ATLASSERT(path.IsDirectory() || !path.Exists());
		// set this flag while we are sync'ed
		// with the worker thread
		m_bItemsAddedSinceLastCrawl = true;
	}
	//if (SetHoldoff())
		SetEvent(m_hWakeEvent);
}
Exemple #2
0
int main(void)
{
	int array[MAXLENGTH] = {1,1,1,2,2,2,3,4,4,4};

	int newLength = RemoveDuplicate(array, MAXLENGTH);

	int i = 0;
	for(i = 0; i < newLength; ++i)
		printf("%d\t", array[i]);
	printf("\n");
	return 0;
}
int main() {


    char str[]="siddharth";

    char* tmp=RemoveDuplicate(str);

    printf("\n%s",tmp);



    return 0;
}
void CFolderCrawler::AddPathForUpdate(const CTGitPath& path)
{
	/* Index file changing*/
	if( GitStatus::IsExistIndexLockFile((CString&)path.GetWinPathString()))
		return;

	if (!CGitStatusCache::Instance().IsPathGood(path))
		return;

	{
		AutoLocker lock(m_critSec);

		RemoveDuplicate(m_pathsToUpdate, path);
		m_pathsToUpdate.push_back(path);
		m_pathsToUpdate.back().SetCustomData(GetTickCount()+1000);
		m_bPathsAddedSinceLastCrawl = true;
	}
	//if (SetHoldoff())
		SetEvent(m_hWakeEvent);
}