Optimization: Could you remove this block and merge the logic with the next `if`?

```javascript
  if (url.charAt(0) == '/') {
    // absolute path or protocol-relative URL
    var i = baseUrl.indexOf('://');
    if (url.charAt(1) === '/') {
      i = baseUrl.indexOf('/', i + 3);
    }
    return baseUrl.substring(0, i) + url;
  } else {
```