Compare commits
2
Commits
1202ae89a5
...
46c96a22ba
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46c96a22ba
|
||
|
|
ae4263320e
|
No files matched your search
+95
-18
@@ -1,7 +1,8 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg version="1.1" width="1200" height="470" onload="init(evt)" viewBox="0 0 1200 470" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:fg="http://github.com/jonhoo/inferno"><!--Flame graph stack visualization. See https://github.com/brendangregg/FlameGraph for latest version, and http://www.brendangregg.com/flamegraphs.html for examples.--><!--NOTES: --><defs><linearGradient id="background" y1="0" y2="1" x1="0" x2="0"><stop stop-color="#eeeeee" offset="5%"/><stop stop-color="#eeeeb0" offset="95%"/></linearGradient></defs><style type="text/css">
|
||||
text { font-family:"Verdana"; font-size:12px; fill:rgb(0,0,0); }
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg version="1.1" width="1200" height="374" onload="init(evt)" viewBox="0 0 1200 374" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:fg="http://github.com/jonhoo/inferno"><!--Flame graph stack visualization. See https://github.com/brendangregg/FlameGraph for latest version, and http://www.brendangregg.com/flamegraphs.html for examples.--><!--NOTES: --><defs><linearGradient id="background" y1="0" y2="1" x1="0" x2="0"><stop stop-color="#eeeeee" offset="5%"/><stop stop-color="#eeeeb0" offset="95%"/></linearGradient></defs><style type="text/css">
|
||||
text { font-family:monospace; font-size:12px }
|
||||
#title { text-anchor:middle; font-size:17px; }
|
||||
#search { opacity:0.1; cursor:pointer; }
|
||||
#matched { text-anchor:end; }
|
||||
#search { text-anchor:end; opacity:0.1; cursor:pointer; }
|
||||
#search:hover, #search.show { opacity:1; }
|
||||
#subtitle { text-anchor:middle; font-color:rgb(160,160,160); }
|
||||
#unzoom { cursor:pointer; }
|
||||
@@ -18,7 +19,7 @@ text { font-family:"Verdana"; font-size:12px; fill:rgb(0,0,0); }
|
||||
var fluiddrawing = true;
|
||||
var truncate_text_right = false;
|
||||
]]><![CDATA["use strict";
|
||||
var details, searchbtn, unzoombtn, matchedtxt, svg, searching, frames;
|
||||
var details, searchbtn, unzoombtn, matchedtxt, svg, searching, frames, known_font_width;
|
||||
function init(evt) {
|
||||
details = document.getElementById("details").firstChild;
|
||||
searchbtn = document.getElementById("search");
|
||||
@@ -26,6 +27,7 @@ function init(evt) {
|
||||
matchedtxt = document.getElementById("matched");
|
||||
svg = document.getElementsByTagName("svg")[0];
|
||||
frames = document.getElementById("frames");
|
||||
known_font_width = get_monospace_width(frames);
|
||||
total_samples = parseInt(frames.attributes.total_samples.value);
|
||||
searching = 0;
|
||||
|
||||
@@ -43,6 +45,9 @@ function init(evt) {
|
||||
svg.removeAttribute("width");
|
||||
// Edge requires us to have a viewBox that gets updated with size changes.
|
||||
var isEdge = /Edge\/\d./i.test(navigator.userAgent);
|
||||
if (!isEdge) {
|
||||
svg.removeAttribute("viewBox");
|
||||
}
|
||||
var update_for_width_change = function() {
|
||||
if (isEdge) {
|
||||
svg.attributes.viewBox.value = "0 0 " + svg.width.baseVal.value + " " + svg.height.baseVal.value;
|
||||
@@ -52,15 +57,12 @@ function init(evt) {
|
||||
frames.attributes.width.value = svg.width.baseVal.value - xpad * 2;
|
||||
|
||||
// Text truncation needs to be adjusted for the current width.
|
||||
var el = frames.children;
|
||||
for(var i = 0; i < el.length; i++) {
|
||||
update_text(el[i]);
|
||||
}
|
||||
update_text_for_elements(frames.children);
|
||||
|
||||
// Keep search elements at a fixed distance from right edge.
|
||||
var svgWidth = svg.width.baseVal.value;
|
||||
searchbtn.attributes.x.value = svgWidth - xpad - 100;
|
||||
matchedtxt.attributes.x.value = svgWidth - xpad - 100;
|
||||
searchbtn.attributes.x.value = svgWidth - xpad;
|
||||
matchedtxt.attributes.x.value = svgWidth - xpad;
|
||||
};
|
||||
window.addEventListener('resize', function() {
|
||||
update_for_width_change();
|
||||
@@ -70,9 +72,6 @@ function init(evt) {
|
||||
unzoom();
|
||||
update_for_width_change();
|
||||
restore_state();
|
||||
if (!isEdge) {
|
||||
svg.removeAttribute("viewBox");
|
||||
}
|
||||
}, 0);
|
||||
} else {
|
||||
restore_state();
|
||||
@@ -181,12 +180,88 @@ function g_to_func(e) {
|
||||
// name before it's searched, do it here before returning.
|
||||
return (func);
|
||||
}
|
||||
function get_monospace_width(frames) {
|
||||
// Given the id="frames" element, return the width of text characters if
|
||||
// this is a monospace font, otherwise return 0.
|
||||
text = find_child(frames.children[0], "text");
|
||||
originalContent = text.textContent;
|
||||
text.textContent = "!";
|
||||
bangWidth = text.getComputedTextLength();
|
||||
text.textContent = "W";
|
||||
wWidth = text.getComputedTextLength();
|
||||
text.textContent = originalContent;
|
||||
if (bangWidth === wWidth) {
|
||||
return bangWidth;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
function update_text_for_elements(elements) {
|
||||
// In order to render quickly in the browser, you want to do one pass of
|
||||
// reading attributes, and one pass of mutating attributes. See
|
||||
// https://web.dev/avoid-large-complex-layouts-and-layout-thrashing/ for details.
|
||||
|
||||
// Fall back to inefficient calculation, if we're variable-width font.
|
||||
// TODO This should be optimized somehow too.
|
||||
if (known_font_width === 0) {
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
update_text(elements[i]);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
var textElemNewAttributes = [];
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
var e = elements[i];
|
||||
var r = find_child(e, "rect");
|
||||
var t = find_child(e, "text");
|
||||
var w = parseFloat(r.attributes.width.value) * frames.attributes.width.value / 100 - 3;
|
||||
var txt = find_child(e, "title").textContent.replace(/\([^(]*\)$/,"");
|
||||
var newX = format_percent((parseFloat(r.attributes.x.value) + (100 * 3 / frames.attributes.width.value)));
|
||||
|
||||
// Smaller than this size won't fit anything
|
||||
if (w < 2 * known_font_width) {
|
||||
textElemNewAttributes.push([newX, ""]);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Fit in full text width
|
||||
if (txt.length * known_font_width < w) {
|
||||
textElemNewAttributes.push([newX, txt]);
|
||||
continue;
|
||||
}
|
||||
|
||||
var substringLength = Math.floor(w / known_font_width) - 2;
|
||||
if (truncate_text_right) {
|
||||
// Truncate the right side of the text.
|
||||
textElemNewAttributes.push([newX, txt.substring(0, substringLength) + ".."]);
|
||||
continue;
|
||||
} else {
|
||||
// Truncate the left side of the text.
|
||||
textElemNewAttributes.push([newX, ".." + txt.substring(txt.length - substringLength, txt.length)]);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
console.assert(textElemNewAttributes.length === elements.length, "Resize failed, please file a bug at https://github.com/jonhoo/inferno/");
|
||||
|
||||
// Now that we know new textContent, set it all in one go so we don't refresh a bazillion times.
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
var e = elements[i];
|
||||
var values = textElemNewAttributes[i];
|
||||
var t = find_child(e, "text");
|
||||
t.attributes.x.value = values[0];
|
||||
t.textContent = values[1];
|
||||
}
|
||||
}
|
||||
|
||||
function update_text(e) {
|
||||
var r = find_child(e, "rect");
|
||||
var t = find_child(e, "text");
|
||||
var w = parseFloat(r.attributes.width.value) * frames.attributes.width.value / 100 - 3;
|
||||
var txt = find_child(e, "title").textContent.replace(/\([^(]*\)$/,"");
|
||||
t.attributes.x.value = format_percent((parseFloat(r.attributes.x.value) + (100 * 3 / frames.attributes.width.value)));
|
||||
|
||||
// Smaller than this size won't fit anything
|
||||
if (w < 2 * fontsize * fontwidth) {
|
||||
t.textContent = "";
|
||||
@@ -194,7 +269,7 @@ function update_text(e) {
|
||||
}
|
||||
t.textContent = txt;
|
||||
// Fit in full text width
|
||||
if (/^ *\$/.test(txt) || t.getComputedTextLength() < w)
|
||||
if (t.getComputedTextLength() < w)
|
||||
return;
|
||||
if (truncate_text_right) {
|
||||
// Truncate the right side of the text.
|
||||
@@ -261,6 +336,7 @@ function zoom(node) {
|
||||
var ymin = parseFloat(attr.y.value);
|
||||
unzoombtn.classList.remove("hide");
|
||||
var el = frames.children;
|
||||
var to_update_text = [];
|
||||
for (var i = 0; i < el.length; i++) {
|
||||
var e = el[i];
|
||||
var a = find_child(e, "rect").attributes;
|
||||
@@ -277,7 +353,7 @@ function zoom(node) {
|
||||
if (ex <= xmin && (ex+ew) >= xmax) {
|
||||
e.classList.add("parent");
|
||||
zoom_parent(e);
|
||||
update_text(e);
|
||||
to_update_text.push(e);
|
||||
}
|
||||
// not in current path
|
||||
else
|
||||
@@ -291,10 +367,11 @@ function zoom(node) {
|
||||
}
|
||||
else {
|
||||
zoom_child(e, xmin, width);
|
||||
update_text(e);
|
||||
to_update_text.push(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
update_text_for_elements(to_update_text);
|
||||
}
|
||||
function unzoom() {
|
||||
unzoombtn.classList.add("hide");
|
||||
@@ -303,8 +380,8 @@ function unzoom() {
|
||||
el[i].classList.remove("parent");
|
||||
el[i].classList.remove("hide");
|
||||
zoom_reset(el[i]);
|
||||
update_text(el[i]);
|
||||
}
|
||||
update_text_for_elements(el);
|
||||
}
|
||||
// search
|
||||
function reset_search() {
|
||||
@@ -411,4 +488,4 @@ function search(term) {
|
||||
function format_percent(n) {
|
||||
return n.toFixed(4) + "%";
|
||||
}
|
||||
]]></script><rect x="0" y="0" width="100%" height="470" fill="url(#background)"/><text id="title" x="50.0000%" y="24.00">Flame Graph</text><text id="details" x="10" y="453.00"> </text><text id="unzoom" class="hide" x="10" y="24.00">Reset Zoom</text><text id="search" x="1090" y="24.00">Search</text><text id="matched" x="1090" y="453.00"> </text><svg id="frames" x="10" width="1180" total_samples="4176"><g><title>[unknown] (1 samples, 0.02%)</title><rect x="0.0000%" y="373" width="0.0239%" height="15" fill="rgb(227,0,7)" fg:x="0" fg:w="1"/><text x="0.2500%" y="383.50"></text></g><g><title>[unknown] (1 samples, 0.02%)</title><rect x="0.0000%" y="357" width="0.0239%" height="15" fill="rgb(217,0,24)" fg:x="0" fg:w="1"/><text x="0.2500%" y="367.50"></text></g><g><title>[unknown] (1 samples, 0.02%)</title><rect x="0.0000%" y="341" width="0.0239%" height="15" fill="rgb(221,193,54)" fg:x="0" fg:w="1"/><text x="0.2500%" y="351.50"></text></g><g><title>[unknown] (1 samples, 0.02%)</title><rect x="0.0000%" y="325" width="0.0239%" height="15" fill="rgb(248,212,6)" fg:x="0" fg:w="1"/><text x="0.2500%" y="335.50"></text></g><g><title>[unknown] (1 samples, 0.02%)</title><rect x="0.0000%" y="309" width="0.0239%" height="15" fill="rgb(208,68,35)" fg:x="0" fg:w="1"/><text x="0.2500%" y="319.50"></text></g><g><title>[unknown] (1 samples, 0.02%)</title><rect x="0.0000%" y="293" width="0.0239%" height="15" fill="rgb(232,128,0)" fg:x="0" fg:w="1"/><text x="0.2500%" y="303.50"></text></g><g><title>[unknown] (1 samples, 0.02%)</title><rect x="0.0000%" y="277" width="0.0239%" height="15" fill="rgb(207,160,47)" fg:x="0" fg:w="1"/><text x="0.2500%" y="287.50"></text></g><g><title>[unknown] (1 samples, 0.02%)</title><rect x="0.0000%" y="261" width="0.0239%" height="15" fill="rgb(228,23,34)" fg:x="0" fg:w="1"/><text x="0.2500%" y="271.50"></text></g><g><title>[unknown] (3 samples, 0.07%)</title><rect x="0.0239%" y="357" width="0.0718%" height="15" fill="rgb(218,30,26)" fg:x="1" fg:w="3"/><text x="0.2739%" y="367.50"></text></g><g><title>[unknown] (3 samples, 0.07%)</title><rect x="0.0239%" y="341" width="0.0718%" height="15" fill="rgb(220,122,19)" fg:x="1" fg:w="3"/><text x="0.2739%" y="351.50"></text></g><g><title>[unknown] (3 samples, 0.07%)</title><rect x="0.0239%" y="325" width="0.0718%" height="15" fill="rgb(250,228,42)" fg:x="1" fg:w="3"/><text x="0.2739%" y="335.50"></text></g><g><title>[unknown] (3 samples, 0.07%)</title><rect x="0.0239%" y="309" width="0.0718%" height="15" fill="rgb(240,193,28)" fg:x="1" fg:w="3"/><text x="0.2739%" y="319.50"></text></g><g><title>[unknown] (3 samples, 0.07%)</title><rect x="0.0239%" y="293" width="0.0718%" height="15" fill="rgb(216,20,37)" fg:x="1" fg:w="3"/><text x="0.2739%" y="303.50"></text></g><g><title>[unknown] (3 samples, 0.07%)</title><rect x="0.0239%" y="277" width="0.0718%" height="15" fill="rgb(206,188,39)" fg:x="1" fg:w="3"/><text x="0.2739%" y="287.50"></text></g><g><title>[unknown] (3 samples, 0.07%)</title><rect x="0.0239%" y="261" width="0.0718%" height="15" fill="rgb(217,207,13)" fg:x="1" fg:w="3"/><text x="0.2739%" y="271.50"></text></g><g><title>[unknown] (2 samples, 0.05%)</title><rect x="0.0479%" y="245" width="0.0479%" height="15" fill="rgb(231,73,38)" fg:x="2" fg:w="2"/><text x="0.2979%" y="255.50"></text></g><g><title>[unknown] (2 samples, 0.05%)</title><rect x="0.0479%" y="229" width="0.0479%" height="15" fill="rgb(225,20,46)" fg:x="2" fg:w="2"/><text x="0.2979%" y="239.50"></text></g><g><title>[unknown] (2 samples, 0.05%)</title><rect x="0.0479%" y="213" width="0.0479%" height="15" fill="rgb(210,31,41)" fg:x="2" fg:w="2"/><text x="0.2979%" y="223.50"></text></g><g><title>[unknown] (1 samples, 0.02%)</title><rect x="0.0718%" y="197" width="0.0239%" height="15" fill="rgb(221,200,47)" fg:x="3" fg:w="1"/><text x="0.3218%" y="207.50"></text></g><g><title>[unknown] (2 samples, 0.05%)</title><rect x="13.6734%" y="261" width="0.0479%" height="15" fill="rgb(226,26,5)" fg:x="571" fg:w="2"/><text x="13.9234%" y="271.50"></text></g><g><title>[unknown] (1 samples, 0.02%)</title><rect x="13.6973%" y="245" width="0.0239%" height="15" fill="rgb(249,33,26)" fg:x="572" fg:w="1"/><text x="13.9473%" y="255.50"></text></g><g><title>[unknown] (1 samples, 0.02%)</title><rect x="13.6973%" y="229" width="0.0239%" height="15" fill="rgb(235,183,28)" fg:x="572" fg:w="1"/><text x="13.9473%" y="239.50"></text></g><g><title>[unknown] (1 samples, 0.02%)</title><rect x="13.6973%" y="213" width="0.0239%" height="15" fill="rgb(221,5,38)" fg:x="572" fg:w="1"/><text x="13.9473%" y="223.50"></text></g><g><title>[unknown] (1 samples, 0.02%)</title><rect x="13.6973%" y="197" width="0.0239%" height="15" fill="rgb(247,18,42)" fg:x="572" fg:w="1"/><text x="13.9473%" y="207.50"></text></g><g><title>[unknown] (1 samples, 0.02%)</title><rect x="13.6973%" y="181" width="0.0239%" height="15" fill="rgb(241,131,45)" fg:x="572" fg:w="1"/><text x="13.9473%" y="191.50"></text></g><g><title>[unknown] (1 samples, 0.02%)</tLine truncated
|
||||
]]></script><rect x="0" y="0" width="100%" height="374" fill="url(#background)"/><text id="title" fill="rgb(0,0,0)" x="50.0000%" y="24.00">Flame Graph</text><text id="details" fill="rgb(0,0,0)" x="10" y="357.00"> </text><text id="unzoom" class="hide" fill="rgb(0,0,0)" x="10" y="24.00">Reset Zoom</text><text id="search" fill="rgb(0,0,0)" x="1190" y="24.00">Search</text><text id="matched" fill="rgb(0,0,0)" x="1190" y="357.00"> </text><svg id="frames" x="10" width="1180" total_samples="3172"><g><title>[ld-linux-x86-64.so.2] (1 samples, 0.03%)</title><rect x="0.0946%" y="261" width="0.0315%" height="15" fill="rgb(227,0,7)" fg:x="3" fg:w="1"/><text x="0.3446%" y="271.50"></text></g><g><title>[ld-linux-x86-64.so.2] (1 samples, 0.03%)</title><rect x="0.0946%" y="245" width="0.0315%" height="15" fill="rgb(217,0,24)" fg:x="3" fg:w="1"/><text x="0.3446%" y="255.50"></text></g><g><title>[ld-linux-x86-64.so.2] (1 samples, 0.03%)</title><rect x="0.0946%" y="229" width="0.0315%" height="15" fill="rgb(221,193,54)" fg:x="3" fg:w="1"/><text x="0.3446%" y="239.50"></text></g><g><title>[ld-linux-x86-64.so.2] (1 samples, 0.03%)</title><rect x="0.0946%" y="213" width="0.0315%" height="15" fill="rgb(248,212,6)" fg:x="3" fg:w="1"/><text x="0.3446%" y="223.50"></text></g><g><title>[ld-linux-x86-64.so.2] (1 samples, 0.03%)</title><rect x="0.0946%" y="197" width="0.0315%" height="15" fill="rgb(208,68,35)" fg:x="3" fg:w="1"/><text x="0.3446%" y="207.50"></text></g><g><title>[ld-linux-x86-64.so.2] (1 samples, 0.03%)</title><rect x="0.0946%" y="181" width="0.0315%" height="15" fill="rgb(232,128,0)" fg:x="3" fg:w="1"/><text x="0.3446%" y="191.50"></text></g><g><title>[ld-linux-x86-64.so.2] (1 samples, 0.03%)</title><rect x="0.0946%" y="165" width="0.0315%" height="15" fill="rgb(207,160,47)" fg:x="3" fg:w="1"/><text x="0.3446%" y="175.50"></text></g><g><title>[ld-linux-x86-64.so.2] (5 samples, 0.16%)</title><rect x="0.0000%" y="277" width="0.1576%" height="15" fill="rgb(228,23,34)" fg:x="0" fg:w="5"/><text x="0.2500%" y="287.50"></text></g><g><title>[unknown] (1 samples, 0.03%)</title><rect x="0.1261%" y="261" width="0.0315%" height="15" fill="rgb(218,30,26)" fg:x="4" fg:w="1"/><text x="0.3761%" y="271.50"></text></g><g><title>[ld-linux-x86-64.so.2] (7 samples, 0.22%)</title><rect x="0.0000%" y="293" width="0.2207%" height="15" fill="rgb(220,122,19)" fg:x="0" fg:w="7"/><text x="0.2500%" y="303.50"></text></g><g><title>[unknown] (2 samples, 0.06%)</title><rect x="0.1576%" y="277" width="0.0631%" height="15" fill="rgb(250,228,42)" fg:x="5" fg:w="2"/><text x="0.4076%" y="287.50"></text></g><g><title>[unknown] (1 samples, 0.03%)</title><rect x="2.3014%" y="133" width="0.0315%" height="15" fill="rgb(240,193,28)" fg:x="73" fg:w="1"/><text x="2.5514%" y="143.50"></text></g><g><title>[unknown] (1 samples, 0.03%)</title><rect x="2.3014%" y="117" width="0.0315%" height="15" fill="rgb(216,20,37)" fg:x="73" fg:w="1"/><text x="2.5514%" y="127.50"></text></g><g><title>sudk::SField::next (82 samples, 2.59%)</title><rect x="2.3329%" y="133" width="2.5851%" height="15" fill="rgb(206,188,39)" fg:x="74" fg:w="82"/><text x="2.5829%" y="143.50">su..</text></g><g><title><alloc::vec::Vec<T,A> as core::ops::index::Index<I>>::index (2 samples, 0.06%)</title><rect x="4.8550%" y="117" width="0.0631%" height="15" fill="rgb(217,207,13)" fg:x="154" fg:w="2"/><text x="5.1050%" y="127.50"></text></g><g><title>core::slice::index::<impl core::ops::index::Index<I> for [T]>::index (2 samples, 0.06%)</title><rect x="4.8550%" y="101" width="0.0631%" height="15" fill="rgb(231,73,38)" fg:x="154" fg:w="2"/><text x="5.1050%" y="111.50"></text></g><g><title><usize as core::slice::index::SliceIndex<[T]>>::index (2 samples, 0.06%)</title><rect x="4.8550%" y="85" width="0.0631%" height="15" fill="rgb(225,20,46)" fg:x="154" fg:w="2"/><text x="5.1050%" y="95.50"></text></g><g><title>sudk::SField::prev (75 samples, 2.36%)</title><rect x="4.9180%" y="133" width="2.3644%" height="15" fill="rgb(210,31,41)" fg:x="156" fg:w="75"/><text x="5.1680%" y="143.50">su..</text></g><g><title><alloc::vec::Vec<T,A> as core::ops::index::Index<I>>::index (24 samples, 0.76%)</title><rect x="6.5259%" y="117" width="0.7566%" height="15" fill="rgb(221,200,47)" fg:x="207" fg:w="24"/><text x="6.7759%" y="127.50"></text></g><g><title>core::slice::index::<impl core::ops::index::Index<I> for [T]>::index (24 samples, 0.76%)</title><rect x="6.5259%" y="101" width="0.7566%" height="15" fill="rgb(226,26,5)" fg:x="207" fg:w="24"/><text x="6.7759%" y="111.50"></text></g><g><title><usize as core::slice::index::SliceIndex<[T]>>::index (24 samples, 0.76%)</title><rect x="6.5259%" y="85" width="0.7566%" height="15" fill="rgb(249,33,26)" fg:x="207" fg:w="24"/><text x="6.7759%" y="95.50"></text></g><g><title><alloc::vec::Vec<T,A> as core::ops::deref::Deref>::deref (9 samples, 0.28%)</title><rect x="9.2055%" y="117" width="0.2837Line truncated
|
||||
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 31 KiB |
+3
-3
@@ -172,7 +172,7 @@ impl SField {
|
||||
// safety:
|
||||
// self.possible_vals is initialized with self.size * self.size
|
||||
// so self.pos can safely be used to index here
|
||||
let possible_vals = unsafe { self.possible_values.get_unchecked(self.pos) };
|
||||
let possible_vals = &self.possible_values[self.pos];
|
||||
|
||||
for nr in possible_vals.iter() {
|
||||
if *nr <= current_nr {
|
||||
@@ -246,7 +246,7 @@ impl SField {
|
||||
}
|
||||
|
||||
fn next(&mut self) -> bool {
|
||||
let new_pos = self.pos + 1 + unsafe { *self.skipf.get_unchecked(self.pos + 1) as usize };
|
||||
let new_pos = self.pos + 1 + self.skipf[self.pos + 1] as usize;
|
||||
|
||||
if new_pos >= NUM_FIELDS {
|
||||
return false;
|
||||
@@ -257,7 +257,7 @@ impl SField {
|
||||
}
|
||||
|
||||
fn prev(&mut self) -> bool {
|
||||
let new_pos = self.pos - 1 - unsafe { *self.skipb.get_unchecked(self.pos) as usize };
|
||||
let new_pos = self.pos - 1 - self.skipb[self.pos] as usize;
|
||||
|
||||
if new_pos >= NUM_FIELDS {
|
||||
return false;
|
||||
|
||||
Reference in new issue
Block a user