Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Commit

Permalink
Improve performance of entry rows
Browse files Browse the repository at this point in the history
  • Loading branch information
david-swift committed May 20, 2024
1 parent c07b071 commit 5c1ae9e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Sources/Adwaita/View/Forms/EntryRow+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ extension EntryRow {
appearFunctions.append { storage, _ in
storage.fields[Self.textField] = text
storage.notify(name: "text") {
if let binding = storage.fields[Self.textField] as? Binding<String> {
binding.wrappedValue = .init(cString: gtk_editable_get_text(storage.pointer))
let newValue = String(cString: gtk_editable_get_text(storage.pointer))
if let binding = storage.fields[Self.textField] as? Binding<String>, binding.wrappedValue != newValue {
binding.wrappedValue = newValue
}
}
}
Expand Down

0 comments on commit 5c1ae9e

Please sign in to comment.