Codebase list mozc / 82b9ef5
Remove redundant NULL/nullptr parameters Calling std::unique_ptr<T>::reset(T*) with NULL/nullptr is just redundant. We can safely remove those NULL/nullptr. This is a mechanical refactoring. No behavior change is intended. REF_BUG=9164610 REF_CL=112205175 REF_TIME=2016-01-14T17:01:23-08:00 REF_TIME_RAW=1452819683 -0800 Yohei Yukawa 8 years ago
20 changed file(s) with 29 addition(s) and 29 deletion(s). Raw diff Collapse all Expand all
5858 }
5959
6060 virtual void TearDown() {
61 jvm_.reset(NULL);
61 jvm_.reset();
6262 }
6363
6464 std::unique_ptr<MockJavaVM> jvm_;
5555 }
5656
5757 virtual void TearDown() {
58 codegen_stream_.reset(NULL);
59 result_stream_.reset(NULL);
58 codegen_stream_.reset();
59 result_stream_.reset();
6060 }
6161
6262 string ExpectedOutput(const string &var_name_base,
4545 }
4646
4747 InputMultiFile::~InputMultiFile() {
48 ifs_.reset(NULL);
48 ifs_.reset();
4949 }
5050
5151 bool InputMultiFile::ReadLine(string* line) {
137137 if (0 != pthread_create(state_->handle_.get(), 0, &Thread::WrapperForPOSIX,
138138 static_cast<void *>(this))) {
139139 state_->is_running_ = false;
140 state_->handle_.reset(nullptr);
140 state_->handle_.reset();
141141 }
142142 }
143143
148148 void Thread::Detach() {
149149 if (state_->handle_ != nullptr) {
150150 pthread_detach(*state_->handle_);
151 state_->handle_.reset(nullptr);
151 state_->handle_.reset();
152152 }
153153 }
154154
160160 return;
161161 }
162162 pthread_join(*state_->handle_, nullptr);
163 state_->handle_.reset(nullptr);
163 state_->handle_.reset();
164164 }
165165
166166 namespace {
242242 // pthread_cancel (or pthread_kill in PThreadCancel on Android) is
243243 // asynchronous. Join the thread to behave like TerminateThread on Windows.
244244 Join();
245 state_->handle_.reset(nullptr);
245 state_->handle_.reset();
246246 }
247247 }
248248
881881 num_bytes, &num_bytes)) {
882882 const DWORD last_error = ::GetLastError();
883883 DLOG(ERROR) << "GetTokenInformation failed. Last error: " << last_error;
884 buffer_.reset(nullptr);
884 buffer_.reset();
885885 return;
886886 }
887887 initialized_ = true;
11071107 }
11081108
11091109 void SystemDictionary::ClearReverseLookupCache() const {
1110 reverse_lookup_cache_.reset(nullptr);
1110 reverse_lookup_cache_.reset();
11111111 }
11121112
11131113 namespace {
5454 }
5555
5656 virtual void TearDown() {
57 louds_trie_.reset(nullptr);
58 louds_trie_builder_.reset(nullptr);
57 louds_trie_.reset();
58 louds_trie_builder_.reset();
5959 }
6060
6161 void AddValue(const string &value) {
8080 void IPCServer::Wait() {
8181 if (server_thread_.get() != NULL) {
8282 server_thread_->Join();
83 server_thread_.reset(NULL);
83 server_thread_.reset();
8484 }
8585 }
8686
00 MAJOR=2
11 MINOR=17
2 BUILD=2413
2 BUILD=2414
33 REVISION=102
44 # NACL_DICTIONARY_VERSION is the target version of the system dictionary to be
55 # downloaded by NaCl Mozc.
430430 void UserHistoryPredictor::WaitForSyncer() {
431431 if (syncer_.get() != nullptr) {
432432 syncer_->Join();
433 syncer_.reset(nullptr);
433 syncer_.reset();
434434 }
435435 }
436436
444444 if (syncer_->IsRunning()) {
445445 return false;
446446 } else {
447 syncer_.reset(nullptr); // remove
447 syncer_.reset();
448448 }
449449 }
450450
284284 CallCommand(client.get(), *(pending_command_.get()));
285285 }
286286 }
287 pending_command_.reset(NULL);
287 pending_command_.reset();
288288
289289 // |renderer_status_| is also protected by mutex.
290290 // Until this method finsihs, SetPendingCommand is blocked.
9696 // Unregisters mocked PackedDataManager.
9797 packed::RegisterPackedDataManager(NULL);
9898 #endif // MOZC_USE_PACKED_DICTIONARY
99 dictionary_mock_.reset(NULL);
99 dictionary_mock_.reset();
100100 usage_stats::UsageStats::ClearAllStatsForTest();
101101 }
102102
200200 if (!storage_->OpenOrCreate(filename.c_str(),
201201 kValueSize, kLRUSize, kSeedValue)) {
202202 LOG(WARNING) << "cannot initialize UserBoundaryHistoryRewriter";
203 storage_.reset(NULL);
203 storage_.reset();
204204 return false;
205205 }
206206
828828 if (!storage_->OpenOrCreate(filename.c_str(),
829829 kValueSize, kLRUSize, kSeedValue)) {
830830 LOG(WARNING) << "cannot initialize UserSegmentHistoryRewriter";
831 storage_.reset(NULL);
831 storage_.reset();
832832 return false;
833833 }
834834
250250 return;
251251 }
252252 context_.swap(prev_context_);
253 prev_context_.reset(NULL);
253 prev_context_.reset();
254254 }
255255
256256 void Session::ClearUndoContext() {
257 prev_context_.reset(NULL);
257 prev_context_.reset();
258258 }
259259
260260 void Session::EnsureIMEIsOn() {
8282
8383 void Louds::Reset() {
8484 index_.Reset();
85 select_cache_.reset(nullptr);
85 select_cache_.reset();
8686 select0_cache_size_ = 0;
8787 select1_cache_size_ = 0;
8888 }
267267 return false;
268268 }
269269 memset(mmap_->begin() + offset, '\0', mmap_->size() - offset);
270 lru_list_.reset(NULL);
270 lru_list_.reset();
271271 map_.clear();
272272 Open(mmap_->begin(), mmap_->size());
273273 return true;
494494
495495 void LRUStorage::Close() {
496496 filename_.clear();
497 mmap_.reset(NULL);
498 lru_list_.reset(NULL);
497 mmap_.reset();
498 lru_list_.reset();
499499 map_.clear();
500500 }
501501
5656 }
5757
5858 virtual void TearDown() {
59 mozc_engine_.reset(NULL);
59 mozc_engine_.reset();
6060 }
6161
6262 client::ClientMock* mock_;
920920 }
921921
922922 void InvalidateLangBarInfoCache() {
923 langbar_info_cache_.reset(nullptr);
923 langbar_info_cache_.reset();
924924 }
925925
926926 void SetDeferredLangBarUpdate(bool enabled, commands::CompositionMode mode) {
632632
633633 TipUiHandler::OnDeactivate(this);
634634
635 thread_context_.reset(nullptr);
635 thread_context_.reset();
636636 StorePointerForCurrentThread(nullptr);
637637
638638 return S_OK;