Prune first to speed up utility function 'o'

Change-Id: I22c46a0a8b690a58c18186aa85c0491e470c3c9b
diff --git a/tools/dev/bash_profile b/tools/dev/bash_profile
index 2a27b83..62a2cf7 100644
--- a/tools/dev/bash_profile
+++ b/tools/dev/bash_profile
@@ -41,8 +41,8 @@
 # Convenience utility to warp to various ONOS source projects
 # e.g. 'o api', 'o dev', 'o'
 function o {
-    cd $(find $ONOS_ROOT/ -type d | egrep -v '\.git|target|gen-src' | \
-        egrep "${1:-$ONOS_ROOT}" | egrep -v "$ONOS_ROOT/.+/src/" | head -n 1)
+    cd $(find $ONOS_ROOT/ -type d -and \( -name '.git' -o -name 'target' -o -name 'gen-src' -o -name 'src' \) -prune -o -type d | \
+        egrep "${1:-$ONOS_ROOT}" | head -n 1)
 }
 
 # Short-hand for 'mvn clean install' for us lazy folk