乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
楼主: Jozi68

[编程交流] VB.net: Perpendicular lines to

[复制链接]

10

主题

973

帖子

909

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
118
发表于 2022-7-6 07:13:49 | 显示全部楼层
I agree.  It is absolutely necessary for referencing outside of the “For” loop.  My statement addresses something more subtle –the reason I used the wording that I did.
 
 
 
A line:
 
Dim ThisVariable AsThatObject
 
Instructs the OS to set aside a certain chunk of memory to contain the object.  There is no reason to keep making that assessment/setting within the loop.  Even if the actual Object or Structure will not be needed from on loop to the next, the same memory address (size and location) can be re-used and avoid repeated Garbage Collections.
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 07:18:30 | 显示全部楼层
 
Well said, and something that I should have picked up on initially... Something which seems so obvious after reading your clarification.
 
Cheers
回复

使用道具 举报

10

主题

973

帖子

909

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
118
发表于 2022-7-6 07:23:48 | 显示全部楼层
The loop would have to be very prolific for these subtleties to make a noticeable difference.  I think it is a good habit to employ none the less.
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 07:31:32 | 显示全部楼层
 
I'm all for this.
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-10 18:59 , Processed in 1.340348 second(s), 58 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表