c++ loop hang if add any code inside if condition : hello i made a code and i see something very very strange. this is my code

    struct Mime {
    	int key;
    	string value;
    };
    
    class Storage {
    
    private:
    
    	int Size;
    	Mime * _storage;
    	int last = 0;
    
    public:
    
    	Storage(int __size) {
    		Size = __size;
    		_storage = new Mime[Size + 2];
    	}
    
    	void add(const Mime & __mime) {
    
    		for (int x = 0; x < last; x++)
    			if (_storage[x].key == __mime.key) {}
    
    		_storage[last++] = __mime;
    	}
    };
    
    void test2() {
    
    	int thisSize = 1000000;
    	Storage storage(thisSize);
    	auto start_t = chrono::high_resolution_clock::now();
    	for (int i = 0; i < thisSize; i++) {
    		Mime temp;
    		temp.key = i;
    		temp.value = "Hey";
    		storage.add(temp);
    	}
    	cout << chrono::duration_cast<chrono::milliseconds>(chrono::high_resolution_clock::now() - start_t).count() << " milliseconds\n" << endl;
    }
    
    
    int main() {
    
    	test2();
    
    	cout << "Done" << endl;
    
    	return 0;
    }

this code run in 120 milliseconds for me. but when i add some code here inside the `{}`

    if (_storage[x].key == __mime.key) {}

like 

    if (_storage[x].key == __mime.key) { return; }

or anything else, my program run in 10 min !!! or sometimes hang !!! by adding return; or something else in this (if) nothing happen in the process because this bet is never happen to run the return; or something else. but when i add something like this return; or something else in this condition, my program hang !!!!!!!!!!!!!!!!! 

