haoayou 发表于 2024-7-10 18:16:53

先入先出的泛型方法 大量节约扫描周期, 避免了使用For 循环

<h4 class="moreLine" style="text-wrap: wrap; box-sizing: border-box; font-family: &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;Helvetica Neue&quot;, Helvetica, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, Arial, sans-serif; padding: 0px; margin: 0px 16px 0px 0px; line-height: 24px; outline: 0px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; background-color: rgb(255, 255, 255); color: rgb(51, 51, 51) !important; font-weight: normal !important; font-size: 14px !important;">众所周知FOR循环是很容易拉搞PLC扫描周期的,那么如何避免呢</h4><h4 class="moreLine" style="box-sizing: border-box; font-family: &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;Helvetica Neue&quot;, Helvetica, &quot;Noto Sans CJK SC&quot;, &quot;WenQuanYi Micro Hei&quot;, Arial, sans-serif; padding: 0px; margin: 0px 16px 0px 0px; line-height: 24px; outline: 0px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; text-wrap: wrap; background-color: rgb(255, 255, 255); color: rgb(51, 51, 51) !important; font-weight: normal !important; font-size: 14px !important;">先入先出的泛型方法 大量节约扫描周期, 避免了使用For 循环<br/></h4><p style="box-sizing: border-box; font-family: &quot;Noto Sans SC&quot;, &quot;Microsoft YaHei&quot;, ΢���ź�, -apple-system, BlinkMacSystemFont, &quot;segoe ui&quot;, Roboto; padding: 0px; margin-top: 0px; margin-bottom: 0px; color: rgb(51, 51, 51);">容器是泛型, 没有指明类型, 可以操作任何数据类型, 先入先出, 而且避免了For循环 , 大量节约了扫描周期, 测试过80万长度的数组 也可以不增加扫描周期的情况下 完成,</p><p style="box-sizing: border-box; font-family: &quot;Noto Sans SC&quot;, &quot;Microsoft YaHei&quot;, ΢���ź�, -apple-system, BlinkMacSystemFont, &quot;segoe ui&quot;, Roboto; padding: 0px; margin-top: 0px; margin-bottom: 0px; color: rgb(51, 51, 51);">优化的和非优化的 都可以。</p><p style="box-sizing: border-box; font-family: &quot;Noto Sans SC&quot;, &quot;Microsoft YaHei&quot;, ΢���ź�, -apple-system, BlinkMacSystemFont, &quot;segoe ui&quot;, Roboto; padding: 0px; margin-top: 0px; margin-bottom: 0px; color: rgb(51, 51, 51);"><br/></p><p><br/></p>
页: [1]
查看完整版本: 先入先出的泛型方法 大量节约扫描周期, 避免了使用For 循环