src/sap.ui.core/src/jquery.sap.history.js
function calcStepsToRealHistory(sCurrentHash, bForward){
			var iIndex = jQuery.inArray(sCurrentHash, hashHistory),
				i;

			if (iIndex !== -1) {
				if (bForward) {
					for (i = iIndex ; i < hashHistory.length ; i++) {
						if (!isVirtualHash(hashHistory[i])) {
							return i - iIndex;
						}
					}
				} else {
					for (i = iIndex ; i >= 0 ; i--) {
						if (!isVirtualHash(hashHistory[i])) {
							return i - iIndex;
						}
					}
					return -1 * (iIndex + 1);
				}
			}
		}
function calcStepsToRealHistory(sCurrentHash, bForward){
			var iIndex = jQuery.inArray(sCurrentHash, hashHistory),
				i;

			if (iIndex !== -1) {
				if (bForward) {
					for (i = iIndex ; i < hashHistory.length ; i++) {
						if (!isVirtualHash(hashHistory[i])) {
							return i - iIndex;
						}
					}
				} else {
					for (i = iIndex ; i >= 0 ; i--) {
						if (!isVirtualHash(hashHistory[i])) {
							return i - iIndex;
						}
					}
					return -1 * (iIndex + 1);
				}
			}
		}
function calcStepsToRealHistory ( sCurrentHash , bForward ) { var iIndex = jQuery . inArray ( sCurrentHash , hashHistory ) , i ; if ( iIndex !== - 1 ) { if ( bForward ) { for ( i = iIndex ; i < hashHistory . length ; i ++ ) { if ( ! isVirtualHash ( hashHistory [ i ] ) ) { return i - iIndex ; } } } else { for ( i = iIndex ; i >= 0 ; i -- ) { if ( ! isVirtualHash ( hashHistory [ i ] ) ) { return i - iIndex ; } } return - 1 * ( iIndex + 1 ) ; } } }
This function calculates the steps forward or backward that need to skip the virtual history states.

@private
This function calculates the steps forward or backward that need to skip the virtual history states .