How to simplify nested ifs

Ozan Süel ozan.sueel at gmail.com
Tue Mar 13 12:20:42 UTC 2018


Hi

I have a construction like the following

if (source) {
   if (source.pool) {
     if (source.pool.repository) {
       if (source.pool.repository.directory) {
	if (source.pool.repository.directory.users) {
	return source.pool.repository.directory.users[ownerID];
						}
					}
				}
			}
		}


More information about the Digitalmars-d-learn mailing list