-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multistreamEnabled を非推奨扱いにする #225
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
タイポと、一点だけ教えてほしい事項があります。
var multistream = configuration.multistreamEnabled | ||
if configuration.spotlightEnabled == .enabled { | ||
multistream = true | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ちょっとわからなくなってしまったので教えて欲しいのですが、ここはなぜ変更したのでしょうか
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
元のコードだと configuration.multistreamEnabled
が Bool? の場合に、configuration.multistreamEnabled || configuration.spotlightEnabled == .enabled
のままだと configuration.multistreamEnabled
を !! したり ?? でデフォルトを与えたりして Bool 型にする必要がありました(そうしないとコンパイルエラーになります)。
今回の変更の目的は multistreamEnabled は Bool? として nil (指定なし) を導入することにあるので、これだと目的が達成されません。
なので、297 行目で一度 var multistream: Bool? を定義して、そのあと spotlightEnabled であれば true に上書きするというコードに変更しました。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ありがとうございます。理解できました。
同じような処理なのでなぜかなと変なところにはまり込んでしまってました。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修正ありがとうございました。 LGTM です。
Configuration
に追加するThis pull request deprecates the
multistreamEnabled
setting in theConfiguration
struct and updates related documentation and initializers to reflect this change. The most important changes include markingmultistreamEnabled
as optional, updating initializers to handle the optional type, and modifying the logic to accommodate the deprecation.Deprecation of
multistreamEnabled
:CHANGES.md
: Added an entry to markmultistreamEnabled
as deprecated and updated documentation comments accordingly.Sora/Configuration.swift
: Updated themultistreamEnabled
property to be optional and modified related documentation comments to indicate its deprecation. [1] [2]Initializer updates:
Sora/Configuration.swift
: Modified initializers to accept an optionalmultistreamEnabled
parameter with a default value ofnil
. [1] [2]Logic adjustments:
Sora/PeerChannel.swift
: Updated the logic to handle the optionalmultistreamEnabled
property and ensure compatibility with thespotlightEnabled
setting.