mirror of
https://github.com/twitter/twemoji.git
synced 2024-06-15 03:35:16 +00:00
Simplified the surrogate-to-codepoint algorithm
This commit is contained in:
parent
3e21d10e5a
commit
af8c1968d3
@ -853,7 +853,7 @@ function createTwemoji(re) {
|
|||||||
while (i < unicodeSurrogates.length) {
|
while (i < unicodeSurrogates.length) {
|
||||||
c = unicodeSurrogates.charCodeAt(i++);
|
c = unicodeSurrogates.charCodeAt(i++);
|
||||||
if (p) {
|
if (p) {
|
||||||
r.push((0x10000 + ((p - 0xD800) << 10) + (c - 0xDC00)).toString(16));
|
r.push(((p << 10) + c - 56613888).toString(16));
|
||||||
p = 0;
|
p = 0;
|
||||||
} else if (0xD800 <= c && c <= 0xDBFF) {
|
} else if (0xD800 <= c && c <= 0xDBFF) {
|
||||||
p = c;
|
p = c;
|
||||||
|
@ -576,7 +576,7 @@ define(function () {
|
|||||||
while (i < unicodeSurrogates.length) {
|
while (i < unicodeSurrogates.length) {
|
||||||
c = unicodeSurrogates.charCodeAt(i++);
|
c = unicodeSurrogates.charCodeAt(i++);
|
||||||
if (p) {
|
if (p) {
|
||||||
r.push((0x10000 + ((p - 0xD800) << 10) + (c - 0xDC00)).toString(16));
|
r.push(((p << 10) + c - 56613888).toString(16));
|
||||||
p = 0;
|
p = 0;
|
||||||
} else if (0xD800 <= c && c <= 0xDBFF) {
|
} else if (0xD800 <= c && c <= 0xDBFF) {
|
||||||
p = c;
|
p = c;
|
||||||
|
@ -575,7 +575,7 @@ var twemoji = (function (
|
|||||||
while (i < unicodeSurrogates.length) {
|
while (i < unicodeSurrogates.length) {
|
||||||
c = unicodeSurrogates.charCodeAt(i++);
|
c = unicodeSurrogates.charCodeAt(i++);
|
||||||
if (p) {
|
if (p) {
|
||||||
r.push((0x10000 + ((p - 0xD800) << 10) + (c - 0xDC00)).toString(16));
|
r.push(((p << 10) + c - 56613888).toString(16));
|
||||||
p = 0;
|
p = 0;
|
||||||
} else if (0xD800 <= c && c <= 0xDBFF) {
|
} else if (0xD800 <= c && c <= 0xDBFF) {
|
||||||
p = c;
|
p = c;
|
||||||
|
2
twemoji.min.js
vendored
2
twemoji.min.js
vendored
File diff suppressed because one or more lines are too long
@ -576,7 +576,7 @@ var twemoji = (function (
|
|||||||
while (i < unicodeSurrogates.length) {
|
while (i < unicodeSurrogates.length) {
|
||||||
c = unicodeSurrogates.charCodeAt(i++);
|
c = unicodeSurrogates.charCodeAt(i++);
|
||||||
if (p) {
|
if (p) {
|
||||||
r.push((0x10000 + ((p - 0xD800) << 10) + (c - 0xDC00)).toString(16));
|
r.push(((p << 10) + c - 56613888).toString(16));
|
||||||
p = 0;
|
p = 0;
|
||||||
} else if (0xD800 <= c && c <= 0xDBFF) {
|
} else if (0xD800 <= c && c <= 0xDBFF) {
|
||||||
p = c;
|
p = c;
|
||||||
|
Loading…
Reference in New Issue
Block a user