Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library org_dartlang_compiler_util; | 5 library org_dartlang_compiler_util; |
| 6 | 6 |
| 7 import "dart:collection"; | 7 import "dart:collection"; |
| 8 import 'util_implementation.dart'; | 8 import 'util_implementation.dart'; |
| 9 import 'characters.dart'; | 9 import 'characters.dart'; |
| 10 | 10 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 101 for (int i = 0; i < string.length; i++) { | 101 for (int i = 0; i < string.length; i++) { |
| 102 int code = string.codeUnitAt(i); | 102 int code = string.codeUnitAt(i); |
| 103 if (code < 0x20 || code == $DEL || code == $DQ || code == $LS || | 103 if (code < 0x20 || code == $DEL || code == $DQ || code == $LS || |
| 104 code == $PS || code == $BACKSLASH || code >= 0x80) { | 104 code == $PS || code == $BACKSLASH || code >= 0x80) { |
| 105 writeEscapedOn(string, buffer); | 105 writeEscapedOn(string, buffer); |
| 106 return; | 106 return; |
| 107 } | 107 } |
| 108 } | 108 } |
| 109 buffer.write(string); | 109 buffer.write(string); |
| 110 } | 110 } |
| 111 | |
| 112 int computeHashCode(part1, [part2, part3, part4]) { | |
|
Johnni Winther
2013/06/23 19:07:42
Wouldn't it be faster to have functions [computeHa
kasperl
2013/06/24 06:32:43
At some point we should probably figure out if usi
| |
| 113 return (part1.hashCode | |
| 114 ^ part2.hashCode | |
| 115 ^ part3.hashCode | |
| 116 ^ part4.hashCode) & 0x3fffffff; | |
| 117 } | |
| OLD | NEW |